def register(self, context, stream):
        """
        Register a newly constructed context and its associated stream, and add
        the stream's receive side to the I/O multiplexer. This method remains
        public while the design has not yet settled.
        """
        _v and LOG.debug('register(%r, %r)', context, stream)
        self._write_lock.acquire()
        try:
            self._stream_by_id[context.context_id] = stream
            self._context_by_id[context.context_id] = context
        finally:
            self._write_lock.release()

        self.broker.start_receive(stream)
        listen(stream, 'disconnect', lambda: self._on_stream_disconnect(stream))
def register ( self , context , stream ) : _v and LOG . debug ( 'register(%r, %r)' , context , stream ) self . _write_lock . acquire ( ) try : self . _stream_by_id [ context . context_id ] = stream self . _context_by_id [ context . context_id ] = context finally : self . _write_lock . release ( ) self . broker . start_receive ( stream ) listen ( stream , 'disconnect' , lambda : self . _on_stream_disconnect ( stream ) )
Register a newly constructed context and its associated stream, and add
        the stream's receive side to the I/O multiplexer. This method remains
        public while the design has not yet settled.