def __init__(self, parameters=None, on_open_callback=None, reconnection_strategy=None): # Let the developer know we could not import SSL if parameters.ssl and not SSL: raise Exception("SSL specified but it is not available") # Call our parent's __init__ Connection.__init__(self, parameters, on_open_callback, reconnection_strategy)
def acknowledge_message(self, channel: Channel, delivery_tag: str, connection: Connection): """ Acknowledge message and move onto the next. All of the required params come from the message callback params. :param channel: callback channel param :param delivery_tag: from the callback method param. eg. method.delivery_tag :param connection: connection object from the callback param """ cb = functools.partial(self._acknowledge_message, channel, delivery_tag) connection.add_callback_threadsafe(cb)
def _init_connection_state(self): Connection._init_connection_state(self) # Set our defaults self.fd = None self.ioloop = None # Event states (base and current) self.base_events = READ | ERROR self.event_state = self.base_events self.socket = None self.write_buffer = None self._ssl_connecting = False self._ssl_handshake = False
def __init__(self, parameters=None, on_open_callback=None, reconnection_strategy=None): # Set our defaults self.fd = None self.ioloop = None self.socket = None # Event states (base and current) self.base_events = READ | ERROR self.event_state = self.base_events # Call our parent's __init__ Connection.__init__(self, parameters, on_open_callback, reconnection_strategy)
def __init__(self, parameters=None, on_open_callback=None, reconnection_strategy=None): # Let the developer know we could not import SSL if parameters.ssl and not SSL: raise Exception("SSL specified but it is not available") # Set our defaults self.fd = None self.ioloop = None self.socket = None # Event states (base and current) self.base_events = READ | ERROR self.event_state = self.base_events # Call our parent's __init__ Connection.__init__(self, parameters, on_open_callback, reconnection_strategy)