Example #1
0
 def __init__(self, connector_name, vumi_helper, msg_helper):
     self.connector_name = connector_name
     self._worker_helper = vumi_helper.get_worker_helper(
         connector_name)
     self._dispatch_helper = MessageDispatchHelper(
         msg_helper, self._worker_helper)
     generate_proxies(self, self._worker_helper)
     generate_proxies(self, self._dispatch_helper)
Example #2
0
    def __init__(self, dispatcher_class, use_riak=False, **msg_helper_args):
        self.dispatcher_class = dispatcher_class
        self.worker_helper = WorkerHelper()
        self.persistence_helper = PersistenceHelper(use_riak=use_riak)
        self.msg_helper = MessageHelper(**msg_helper_args)
        self.dispatch_helper = MessageDispatchHelper(self.msg_helper,
                                                     self.worker_helper)

        # Proxy methods from our helpers.
        generate_proxies(self, self.msg_helper)
        generate_proxies(self, self.worker_helper)
        generate_proxies(self, self.dispatch_helper)
Example #3
0
    def __init__(self, dispatcher_helper, connector_name):
        self.msg_helper = dispatcher_helper.msg_helper
        self.worker_helper = WorkerHelper(
            connector_name, dispatcher_helper.worker_helper.broker)
        self.dispatch_helper = MessageDispatchHelper(self.msg_helper,
                                                     self.worker_helper)

        generate_proxies(self, self.worker_helper)
        generate_proxies(self, self.dispatch_helper)

        # We don't want to be able to make workers with this helper.
        del self.get_worker
        del self.cleanup_worker
Example #4
0
    def __init__(self, application_class, use_riak=False, **msg_helper_args):
        self.application_class = application_class
        self.persistence_helper = PersistenceHelper(use_riak=use_riak)
        self.msg_helper = MessageHelper(**msg_helper_args)
        self.transport_name = self.msg_helper.transport_name
        self.worker_helper = WorkerHelper(self.msg_helper.transport_name)
        self.dispatch_helper = MessageDispatchHelper(self.msg_helper,
                                                     self.worker_helper)

        # Proxy methods from our helpers.
        generate_proxies(self, self.msg_helper)
        generate_proxies(self, self.worker_helper)
        generate_proxies(self, self.dispatch_helper)
        generate_proxies(self, self.persistence_helper)
Example #5
0
class RouterConnectorHelper(object):
    implements(IHelper)

    def __init__(self, connector_name, vumi_helper, msg_helper):
        self.connector_name = connector_name
        self._worker_helper = vumi_helper.get_worker_helper(
            connector_name)
        self._dispatch_helper = MessageDispatchHelper(
            msg_helper, self._worker_helper)
        generate_proxies(self, self._worker_helper)
        generate_proxies(self, self._dispatch_helper)

    @inlineCallbacks
    def cleanup(self):
        yield self._dispatch_helper.cleanup()
        yield self._worker_helper.cleanup()
Example #6
0
    def __init__(self, worker_class, **msg_helper_args):
        self._worker_class = worker_class

        self.vumi_helper = VumiApiHelper()
        self._app_helper = ApplicationHelper(self._conversation_type(),
                                             self.vumi_helper)
        self.msg_helper = GoMessageHelper(**msg_helper_args)
        self.transport_name = self.msg_helper.transport_name
        self.worker_helper = self.vumi_helper.get_worker_helper(
            self.transport_name)
        self.dispatch_helper = MessageDispatchHelper(self.msg_helper,
                                                     self.worker_helper)

        # Proxy methods from our helpers.
        generate_proxies(self, self._app_helper)
        generate_proxies(self, self.msg_helper)
        generate_proxies(self, self.worker_helper)
        generate_proxies(self, self.dispatch_helper)
Example #7
0
    def __init__(self, transport_class, use_riak=False, **msg_helper_args):
        self.transport_class = transport_class
        self.persistence_helper = PersistenceHelper(use_riak=use_riak)
        self.msg_helper = MessageHelper(**msg_helper_args)
        self.transport_name = self.msg_helper.transport_name

        self.worker_helper = WorkerHelper(connector_name=self.transport_name,
                                          status_connector_name="%s.status" %
                                          (self.transport_name, ))

        self.dispatch_helper = MessageDispatchHelper(self.msg_helper,
                                                     self.worker_helper)

        # Proxy methods from our helpers.
        generate_proxies(self, self.msg_helper)
        generate_proxies(self, self.worker_helper)
        generate_proxies(self, self.dispatch_helper)
        generate_proxies(self, self.persistence_helper)