def __init__(self, worker, key, stderr, timeout, autoclose): """EngineClient initializer. Should be called from derived classes. Arguments: worker -- parent worker instance key -- client key used by MsgTree (eg. node name) stderr -- boolean set if stderr is on a separate stream timeout -- client execution timeout value (float) autoclose -- boolean set to indicate whether this engine client should be aborted as soon as all other non-autoclosing clients have finished. """ EngineBaseTimer.__init__(self, timeout, -1, autoclose) self._reg_epoch = 0 # registration generation number # read-only public self.registered = False # registered on engine or not self.delayable = True # subject to fanout limit self.worker = worker if key is None: key = id(worker) self.key = key # boolean indicating whether stderr is on a separate fd self._stderr = stderr # streams associated with this client self.streams = EngineClientStreamDict()
def __init__(self, worker, stderr, timeout, autoclose): """ Initializer. Should be called from derived classes. """ EngineBaseTimer.__init__(self, timeout, -1, autoclose) # engine-friendly variables self._events = 0 # current configured set of # interesting events (read, # write) for client self._new_events = 0 # new set of interesting events self._reg_epoch = 0 # registration generation number # read-only public self.registered = False # registered on engine or not self.delayable = True # subject to fanout limit self.worker = worker # boolean indicating whether stderr is on a separate fd self._stderr = stderr # associated file descriptors self.fd_error = None self.fd_reader = None self.fd_writer = None # initialize error, read and write buffers self._ebuf = "" self._rbuf = "" self._wbuf = "" self._weof = False # write-ends notification
def __init__(self, worker, stderr, timeout, autoclose): """ Initializer. Should be called from derived classes. """ EngineBaseTimer.__init__(self, timeout, -1, autoclose) self._reg_epoch = 0 # registration generation number # read-only public self.registered = False # registered on engine or not self.delayable = True # subject to fanout limit self.worker = worker # boolean indicating whether stderr is on a separate fd self._stderr = stderr # streams associated with this client self.streams = EngineClientStreamDict()