def __init__(self,<EOL>service_name: str,<EOL>socket_filter: str='<STR_LIT>',<EOL>run_control_loop: bool=False,<EOL>socket_configuration: dict=None,<EOL>**kwargs):
self._run_control_loop = run_control_loop<EOL>self.config = _get_default_adapter_config()<EOL>if socket_configuration is not None:<EOL><INDENT>self.config.update(socket_configuration)<EOL><DEDENT>self.publish_socket = None<EOL>self.subscription_socket = None<EOL>self.command_socket = None<EOL>self.control_socket = None<EOL>self.request_socket = None<EOL>self.chatter = _Subject()<EOL>self.command = _Subject()<EOL>self.request = _Subject()<EOL>self._service_name = service_name<EOL>self._uuid = str(_uuid.uuid1())<EOL>self._socket_filter = socket_filter<EOL>self._logger = _logging.getLogger(self._service_name + '<STR_LIT>')<EOL>socket = {'<STR_LIT:address>': self.config['<STR_LIT:address>'],<EOL>'<STR_LIT>': self.config['<STR_LIT>'],<EOL>'<STR_LIT>': self._logger}<EOL>self.loop = _IOLoop()<EOL>if run_control_loop:<EOL><INDENT>socket['<STR_LIT>'] = self.loop<EOL><DEDENT>self._socket_factory = _SocketFactory(**socket)<EOL>self._config_convert_to_address_helper()<EOL>self._run_thread = None<EOL>self._heartbeat_reciever = _HeartbeatReciever(self, self.loop)<EOL>self.chatter.subscribe(self._heartbeat_reciever.message_recieved)<EOL>self._messaging_logger = _MessagingLogger(service_name)<EOL>self.scheduler = _Scheduler()<EOL>
Adapter Messaging Helper. In the future this class will likely be
broken into two concerete implementations. In the meantime, do _NOT_
use the sockets methods individually. If the class is running a
control loop this will throw an error. Use the `add_callback` method
if you must to access the socket methods.

If you do not use the internal control loop, you will have to recv
each method individually, and call the `on_next` method for the
appropriate subject

Args:
    service_name (str): The name of the service that this messaging
        will provide. If multiple instances are to be launched, need
        generate a unique service name everytime or it will cause
        errors
    socket_filter (str): An optional filter to put on the chatter
        socket. Recommend leaving as is unless you are publishing
        chatter messages with targets.
    run_control_loop (bool): If `True`, this class will run all of
        it's code asyncrously using an `IOLoop`. If `False`, all called
        commands will be blocking in a sense. Recommend setting this
        to `True` unless you are integrating another control loop in
        place of `IOLoop`.
    socket_configuration (:obj:`dict`, optional): The zmq socket
        configuration. Defaults to a locally run assistant, show below
        {
            'protocol':   'tcp'
            'address': '127.0.0.1'
            'chatter_publish_port': 4000
            'chatter_subscription_port': [4001,]
            'command_port': 4002
            'request_port': 4003
            'control_port': 4005
        }
    **kwargs: Currently unused

Attributes:
    chatter (rx.Subject): Use the `subscribe` method on this to get
        access to all imcoming messages, including heartbeats.
    command (rx.Subject): Use the `subscribe` method on this to get
        access to all incoming commands coming from the robot.
    request (rx.Subject): Currently unused
    send_chatter (Callable): Send chatter to the robot. Useful for
        chat systems such as IRC/XMPP/Slack, etc.
    send_command (Callable): Send a command to the robot. Be careful
        to authenticate your users as the robot has no authentication.
    send_command_response (Callable): Send a response back to the
        robot in response to a command
    add_callback (Callable): add a callback to the control loop if it
        is being run
    run (Callable): run the internal event loop