class_docstr: Produce data from ZMQ PULL socket(s).
  It is the receiver-side counterpart of :func:`send_dataflow_zmq`, which uses :mod:`tensorpack.utils.serialize`
  for serialization.
  See http://tensorpack.readthedocs.io/tutorial/efficient-dataflow.html#distributed-dataflow
  
  Attributes:
      cnt1, cnt2 (int): number of data points received from addr1 and addr2
class_docstr_tok: ["Produce","data","from","ZMQ","PULL","socket","(","s",")",".","It","is","the","receiver-side","counterpart","of",":","func",":","`","send_dataflow_zmq","`",",","which","uses",":","mod",":","`","tensorpack.utils.serialize","`","for","serialization",".","See","http",":","\/\/tensorpack.readthedocs.io\/tutorial\/efficient-dataflow.html","#","distributed-dataflow","Attributes",":","cnt1",",","cnt2","(","int",")",":","number","of","data","points","received","from","addr1","and","addr2"]
code: def __iter__(self):
      with self._guard:
          try:
              ctx = zmq.Context()
              if self._addr2 is None:
                  socket = ctx.socket(zmq.PULL)
                  socket.set_hwm(self._hwm)
                  self.bind_or_connect(socket, self._addr1)
  
                  while True:
                      dp = loads(socket.recv(copy=False))
                      yield dp
                      self.cnt1 += 1
              else:
                  socket1 = ctx.socket(zmq.PULL)
                  socket1.set_hwm(self._hwm)
                  self.bind_or_connect(socket1, self._addr1)
  
                  socket2 = ctx.socket(zmq.PULL)
                  socket2.set_hwm(self._hwm)
                  self.bind_or_connect(socket2, self._addr2)
  
                  poller = zmq.Poller()
                  poller.register(socket1, zmq.POLLIN)
                  poller.register(socket2, zmq.POLLIN)
  
                  while True:
                      evts = poller.poll()
                      for sock, evt in evts:
                          dp = loads(sock.recv(copy=False))
                          yield dp
                          if sock == socket1:
                              self.cnt1 += 1
                          else:
                              self.cnt2 += 1
          finally:
              ctx.destroy(linger=0)
  
file_path: tensorpack/tensorpack/dataflow/remote.py
imports: import multiprocessing
  import time
  from collections import deque
  import tqdm
  from ..utils import logger
  from ..utils.concurrency import DIE
  from ..utils.serialize import dumps, loads
  from ..utils.utils import get_tqdm_kwargs
  from .base import DataFlow, DataFlowReentrantGuard
label_desc: Use image node_id 4 for calling the RemoteDataZMQ obj's underlying member method code with example usage: obj.__iter__() without return types