def pusher(url, count, size, poll, copy):
 ctx = zmq.Context()
 s = ctx.socket(zmq.PUSH)
 if poll:
  p = zmq.Poller()
  p.register(s)
 s.connect(url)
 msg = zmq.Message((' ' * size))
 block = (zmq.NOBLOCK if poll else 0)
 for i in range(count):
  if poll:
   res = p.poll()
   assert (res[0][1] & zmq.POLLOUT)
  s.send(msg, block, copy=copy)
 s.close()
 ctx.term()

def pusher ( url , count , size , poll , copy ) : ctx = zmq . Context ( ) s = ctx . socket ( zmq . PUSH ) if poll : p = zmq . Poller ( ) p . register ( s ) s . connect ( url ) msg = zmq . Message ( ( ' ' * size ) ) block = ( zmq . NOBLOCK if poll else 0 ) for i in range ( count ) : if poll : res = p . poll ( ) assert ( res [ 0 ] [ 1 ] & zmq . POLLOUT ) s . send ( msg , block , copy = copy ) s . close ( ) ctx . term ( )
send a bunch of messages on a push socket .