def setup_worker(self): self.vumi_api = yield VumiApi.from_config_async(self.config) config = self.get_static_config() self.webserver = self.start_web_resources([ (AuthorizedResource(self, ConversationApiResource), config.web_path), (httprpc.HttpRpcHealthResource(self), config.health_path) ], config.web_port)
def setup_worker(self): config = self.get_static_config() riak = yield TxRiakManager.from_config(config.riak_manager) redis = yield TxRedisManager.from_config(config.redis_manager) self.store = MessageStore(riak, redis) site = build_web_site({ config.web_path: MessageStoreResource(self.store), config.health_path: httprpc.HttpRpcHealthResource(self), }) self.addService( StreamServerEndpointService(config.twisted_endpoint, site))
def startWorker(self): web_path = self.config['web_path'] web_port = int(self.config['web_port']) health_path = self.config['health_path'] riak = yield TxRiakManager.from_config(self.config['riak_manager']) redis = yield TxRedisManager.from_config(self.config['redis_manager']) self.store = MessageStore(riak, redis) self.webserver = self.start_web_resources([ (MessageStoreAPI(self.store), web_path), (httprpc.HttpRpcHealthResource(self), health_path), ], web_port)
def setup_worker(self): config = self.get_static_config() self.vumi_api = yield VumiApi.from_config_async({ 'redis_manager': config.redis_manager, 'riak_manager': config.riak_manager, }) self.realm = GoUserRealm(self._rpc_resource_for_user) site = build_web_site({ config.web_path: GoUserAuthSessionWrapper( self.realm, self.vumi_api), config.health_path: httprpc.HttpRpcHealthResource(self), }) self._web_service = StreamServerEndpointService( config.twisted_endpoint, site) self._web_service.startService()
def setup_worker(self): config = self.get_static_config() self.redis_manager = yield TxRedisManager.from_config( config.redis_manager) tagpool = TagpoolManager(self.redis_manager) rpc = TagpoolApiServer(tagpool) addIntrospection(rpc) site = build_web_site({ config.web_path: rpc, config.health_path: httprpc.HttpRpcHealthResource(self), }) self.addService( StreamServerEndpointService(config.twisted_endpoint, site))
def setup_application(self): yield super(NoStreamingHTTPWorker, self).setup_application() config = self.get_static_config() self.web_path = config.web_path self.web_port = config.web_port self.health_path = config.health_path # Set these to empty dictionaries because we're not interested # in using any of the helper functions at this point. self._event_handlers = {} self._session_handlers = {} self.webserver = self.start_web_resources([ (self.get_conversation_resource(), self.web_path), (httprpc.HttpRpcHealthResource(self), self.health_path), ], self.web_port)