PKgAo(#(#uzmq-0.1.1/uzmq.html uzmq Package — uzmq documentation

uzmq Package

Classes

Table Of Contents

Previous topic

API

Next topic

ZMQPoll handle

This Page




PKgA}$!)!)uzmq-0.1.1/genindex.html Index — uzmq documentation



PKgAMчuzmq-0.1.1/objects.inv# Sphinx inventory version 2 # Project: uzmq # Version: 0.1 # The remainder of this file is compressed using zlib. xڕn D jz^m61nSe2cҍ6(XUᠬZy:@3N"J='Tg% vm%ygbc⭏?8*֬ro{"*[(σu\~:MC@U{f $ ;r.4ro|1_LrVsي6DNeZT7|7Ic3A%ZKZ#$ QgZh%%ig{0b ,|PKgAaf<f<uzmq-0.1.1/zmq.html ZMQ handle — uzmq documentation

ZMQ handle

class uzmq.sock.ZMQ(loop, socket)[source]

Bases: object

Parameters:
  • loop – loop object where this handle runs (accessible through Poll.loop).
  • socket (int) – zmq socket

The ZMQ handles provides qsynchronous ZMQ sockets functionnality both for bound and connected sockets.

close()[source]

Close the ZMQ handle. After a handle has been closed no other operations can be performed on it.

flush()[source]

Flush pending messages.

This method safely handles all pending incoming and/or outgoing messages, bypassing the inner loop, passing them to the registered callbacks.

start_read(callback, copy=True, track=False)[source]
Parameters:
  • callback – callable callback must take exactly one argument, which will be a /iist, as returned by socket.recv_multipart() if callback is None, recv callbacks are disabled.
  • copy – bool copy is passed directly to recv, so if copy is False, callback will receive Message objects. If copy is True, then callback will receive bytes/str objects.
  • track – bool Should the message be tracked for notification that ZMQ has finished with it? (ignored if copy=True)

Callback signature: callback(zmq_handle, msg, error).

Start reading for incoming messages from the remote endpoint.

stop()[source]

Stop the ZMQ handle

stop_read()[source]

Stop reading data from the remote endpoint.

write(msg, flags=0, copy=True, track=False, callback=None)[source]
Parameters:
  • msg – object, str, Frame The content of the message
  • flags – int Any supported flag
  • copy – bool Should the message be tracked for notification that ZMQ has finished with it? (ignored if copy=True)
  • track – bool Should the message be tracked for notification that ZMQ has finished with it? (ignored if copy=True)

Callback signature: callback(zmq_handle, msg, status).

Send a message. See zmq.socket.send for details.
write_multipart(msg, flags=0, copy=True, track=False, callback=None)[source]
Parameters:
  • msg – object, str, Frame, the content of the message
  • flags – int Any supported flag
  • copy – bool Should the message be tracked for notification that ZMQ has finished with it? (ignored if copy=True)
  • track – bool Should the message be tracked for notification that ZMQ has finished with it? (ignored if copy=True)

Callback signature: callback(zmq_handle, msg, status).

Send a multipart message. See zmq.socket.send_multipart for details.

Previous topic

ZMQPoll handle

Next topic

CHANGES

This Page




PKgAFluzmq-0.1.1/py-modindex.html Python Module Index — uzmq documentation

Python Module Index

u
 
u
uzmq
    uzmq.__init__
    uzmq.poll
    uzmq.sock



PKgAB<B<uzmq-0.1.1/index.html Welcome to uzmq’s documentation! — uzmq documentation

Welcome to uzmq’s documentation!

uzmq

libuv interface for ZeroMQ for your Python programs.

With uzmq you can use zmq sockets with the libuv event loop binding proposed by the pyuv library

Build Status

Features

Note

uzmq source code is hosted on Github

Example of usage

Example of an echo server using a Poll handle:

import pyuv
import zmq
import uzmq

loop = pyuv.Loop.default_loop()

ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind('tcp://127.0.0.1:5555')


def rep_handler(handle, events, errors):
    # We don't know how many recv's we can do?
    msg = s.recv()
    # No guarantee that we can do the send. We need a way of putting the
    # send in the event loop.
    s.send(msg)


poll = uzmq.ZMQPoll(loop, s)
poll.start(pyuv.UV_READABLE, rep_handler)

loop.run()

The same but using a ZMQ handle:

import pyuv
import zmq
import uzmq


loop = pyuv.Loop.default_loop()

ctx = zmq.Context()
s = ctx.socket(zmq.REP)
s.bind('tcp://127.0.0.1:5555')


stream = uzmq.ZMQ(loop, s)

def echo(handle, msg, err):
    print " ".join(msg)
    stream.write_multipart(msg)

stream.start_read(echo)

loop.run()

Contents:

Indices and tables

Table Of Contents

Next topic

API

This Page




PKgAU=mq q uzmq-0.1.1/searchindex.jsSearch.setIndex({objects:{"uzmq.poll.ZMQPoll":{stop:[1,1,1,""],start:[1,1,1,""],closed:[1,3,1,""],active:[1,3,1,""],close:[1,1,1,""],loop:[1,3,1,""]},"uzmq.sock":{ZMQ:[4,2,1,""]},uzmq:{poll:[1,0,1,""],sock:[4,0,1,""],"__init__":[5,0,1,""]},"uzmq.sock.ZMQ":{stop:[4,1,1,""],write:[4,1,1,""],write_multipart:[4,1,1,""],flush:[4,1,1,""],close:[4,1,1,""],start_read:[4,1,1,""],stop_read:[4,1,1,""]},"uzmq.poll":{ZMQPoll:[1,2,1,""]}},terms:{all:4,code:0,tcp:0,through:[1,4],poll_handl:1,paramet:[1,4],content:[0,4],onli:1,monitor:1,how:0,activ:1,send:[0,4],should:4,program:0,bypass:4,rep_handl:0,zmq:[2,0,4,1,5],take:4,errorno:1,them:4,sourc:[1,0,4],"return":4,fals:4,safe:4,stop:[1,4],initi:3,know:0,docutil:5,server:0,provid:4,api:[0,2],notif:4,updat:1,where:[1,4],page:0,frame:4,see:4,multipart:4,flush:4,pyuv:[0,1],close:[1,4],event:[0,1],stop_read:4,index:0,statu:4,detect:1,rep:0,access:[1,4],version:[0,3],print:0,"import":0,method:4,recv_multipart:4,signatur:[1,4],object:[1,4],run:[1,0,4],usag:0,host:0,base:[1,4],releas:3,span:5,"byte":4,recv:[0,4],zmqpoll:[1,0,2,5],both:4,search:0,socket:[1,0,4],ctx:0,uv_writ:1,outgo:4,context:0,mani:0,chang:[0,3],iist:4,disabl:4,oper:[1,4],note:0,send_multipart:4,directli:4,readabl:1,modul:0,bound:4,echo:0,put:0,write_multipart:[0,4],been:[1,4],poll:[1,0,4],your:0,from:4,wai:0,support:4,regist:4,messag:4,start:[1,0,4],pend:4,interfac:0,inner:4,handl:[2,0,4,1,5],msg:[0,4],call:1,zeromq:0,"function":1,copi:4,ani:[1,4],flag:4,def:0,alreadi:1,exactli:4,"true":4,must:4,qsynchron:4,none:[1,4],endpoint:4,join:0,err:0,possibl:1,remot:4,exampl:0,can:[1,0,4],str:4,error:[0,4],start_read:[0,4],loop:[1,0,4],connect:4,pre:5,featur:0,stream:0,"int":[1,4],pass:4,argument:4,indic:[0,1],packag:[0,2,5],liter:5,tabl:0,zmq_handl:4,guarante:0,need:0,incom:4,readibl:1,welcom:0,callback:[1,4],receiv:[1,4],when:1,detail:4,same:0,write:4,python:0,other:[1,4],bool:4,librari:0,which:4,uv_read:[0,1],writabl:1,you:0,document:0,simpl:0,functionn:4,finish:4,track:4,after:[1,4],data:4,"class":[1,0,4,5],github:0,don:0,sock:4,read:[1,4],bind:0,mask:1,perform:[1,4],uzmq:[2,0,4,1,5],ignor:4,thi:[1,4],callabl:[1,4],default_loop:0,libuv:0,propos:0},objtypes:{"0":"py:module","1":"py:method","2":"py:class","3":"py:attribute"},titles:["Welcome to uzmq’s documentation!","ZMQPoll handle","API","CHANGES","ZMQ handle","uzmq Package"],objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"],"3":["py","attribute","Python attribute"]},filenames:["index","poll","api","news","zmq","uzmq"]})PKgA|'uzmq-0.1.1/news.html CHANGES — uzmq documentation

CHANGES

2012/11/07 - version 0.1.0

Initial release

Table Of Contents

Previous topic

ZMQ handle

This Page




PKgA.uzmq-0.1.1/.buildinfo# Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. config: a2ebf38b32a971a8def378abc7fcd0aa tags: fbb0d17656682115ca4d033fb2f83ba1 PKgAC44uzmq-0.1.1/poll.html ZMQPoll handle — uzmq documentation

ZMQPoll handle

ZMQPoll: ZMQ Poll handle

class uzmq.poll.ZMQPoll(loop, socket)[source]

Bases: object

Parameters:
  • loop – loop object where this handle runs (accessible through Poll.loop).
  • socket (int) – zmq socket to be monitored for readibility or writability.

ZMQPoll ZMQPoll handles can be used to monitor any ZMQ sockets for readability or writability.

loop

Read only

pyuv.Loop object where this handle runs.

active[source]

Read only

Indicates if this handle is active.

close(callback=None)[source]
Parameters:callback (callable) – Function that will be called after the ZMQPoll handle is closed.

Close the ZMQPoll handle. After a handle has been closed no other operations can be performed on it.

closed[source]

Read only

Indicates if this handle is closing or already closed.

start(events, callback)[source]
Parameters:
  • events – int Mask of events that will be detected. The possible events are pyuv.UV_READABLE or pyuv.UV_WRITABLE.
  • callback – callable Function that will be called when the Poll handle receives events.

Callback signature: callback(poll_handle, events, errorno).

Start or update the event mask of the ZMQPoll handle.

stop()[source]

Stop the Poll handle.

Previous topic

uzmq Package

Next topic

ZMQ handle

This Page




PKgAUUuzmq-0.1.1/search.html Search — uzmq documentation

Search

Please activate JavaScript to enable the search functionality.

From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.




PKgAW R!R!uzmq-0.1.1/api.html API — uzmq documentation

Previous topic

Welcome to uzmq’s documentation!

Next topic

uzmq Package

This Page




PKgAu %uzmq-0.1.1/_static/comment-bright.pngPNG  IHDRa OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_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]qp`a4AF0` @1Α! ,20IeBԜ) q10ʰPaVڥ ub[;PKgA:>>>!uzmq-0.1.1/_static/searchtools.js/* * searchtools.js_t * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * helper function to return a node containing the * search summary for a given text. keywords is a list * of stemmed words, hlwords is the list of normal, unstemmed * words. the first one is used to find the occurance, the * latter for highlighting it. */ jQuery.makeSearchSummary = function(text, keywords, hlwords) { var textLower = text.toLowerCase(); var start = 0; $.each(keywords, function() { var i = textLower.indexOf(this.toLowerCase()); if (i > -1) start = i; }); start = Math.max(start - 120, 0); var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); var rv = $('
').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); return rv; } /** * Porter Stemmer */ var Stemmer = function() { var step2list = { ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log' }; var step3list = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' }; var c = "[^aeiou]"; // consonant var v = "[aeiouy]"; // vowel var C = c + "[^aeiouy]*"; // consonant sequence var V = v + "[aeiou]*"; // vowel sequence var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; var suffix; var firstch; var origword = w; if (w.length < 3) return w; var re; var re2; var re3; var re4; firstch = w.substr(0,1); if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) w = w.replace(re,"$1$2"); else if (re2.test(w)) w = w.replace(re2,"$1$2"); // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) w = w + "e"; } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) w = stem + "i"; } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) w = stem; } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) w = stem; } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; } } /** * Search Module */ var Search = { _index : null, _queued_query : null, _pulse_status : -1, init : function() { var params = $.getQueryParameters(); if (params.q) { var query = params.q[0]; $('input[name="q"]')[0].value = query; this.performSearch(query); } }, loadIndex : function(url) { $.ajax({type: "GET", url: url, data: null, success: null, dataType: "script", cache: true}); }, setIndex : function(index) { var q; this._index = index; if ((q = this._queued_query) !== null) { this._queued_query = null; Search.query(q); } }, hasIndex : function() { return this._index !== null; }, deferQuery : function(query) { this._queued_query = query; }, stopPulse : function() { this._pulse_status = 0; }, startPulse : function() { if (this._pulse_status >= 0) return; function pulse() { Search._pulse_status = (Search._pulse_status + 1) % 4; var dotString = ''; for (var i = 0; i < Search._pulse_status; i++) dotString += '.'; Search.dots.text(dotString); if (Search._pulse_status > -1) window.setTimeout(pulse, 500); }; pulse(); }, /** * perform a search for something */ performSearch : function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); this.status = $('

').appendTo(this.out); this.output = $('