示例#1
0
 def _set_bus(cls, service):
     registry_client = RegistryClient(asyncio.get_event_loop(), cls.registry_host, cls.registry_port)
     registry_client.connect()
     tcp_bus = TCPBus(registry_client)
     pubsub_bus = PubSubBus(registry_client)
     registry_client.bus = tcp_bus
     if isinstance(service, TCPService):
         tcp_bus.tcp_host = service
     if isinstance(service, HTTPService):
         tcp_bus.http_host = service
     service.tcp_bus = tcp_bus
     service.pubsub_bus = pubsub_bus
示例#2
0
文件: host.py 项目: amanwriter/vyked
    def _set_bus(cls, service):
        registry_client = RegistryClient(
            asyncio.get_event_loop(), cls.registry_host, cls.registry_port, cls.registry_client_ssl)
        tcp_bus = TCPBus(registry_client)
        registry_client.conn_handler = tcp_bus
        # pubsub_bus = PubSubBus(registry_client, ssl_context=cls._tcp_service._ssl_context)
        pubsub_bus = PubSubBus(registry_client)  # , cls._tcp_service._ssl_context)

        registry_client.bus = tcp_bus
        if isinstance(service, TCPService):
            tcp_bus.tcp_host = service
        if isinstance(service, HTTPService):
            tcp_bus.http_host = service
        service.tcp_bus = tcp_bus
        service.pubsub_bus = pubsub_bus
示例#3
0
 def _set_bus(cls, service):
     registry_client = RegistryClient(asyncio.get_event_loop(),
                                      cls.registry_host, cls.registry_port)
     if not cls.ronin:
         asyncio.get_event_loop().run_until_complete(
             registry_client.connect())
     tcp_bus = TCPBus(registry_client)
     pubsub_bus = PubSubBus(registry_client)
     registry_client.bus = tcp_bus
     if isinstance(service, TCPService):
         tcp_bus.tcp_host = service
     if isinstance(service, HTTPService):
         tcp_bus.http_host = service
     service.tcp_bus = tcp_bus
     service.pubsub_bus = pubsub_bus
示例#4
0
文件: host.py 项目: shanmbic/vyked
    def _set_bus(cls, service):
        registry_client = RegistryClient(asyncio.get_event_loop(),
                                         cls.registry_host, cls.registry_port,
                                         cls.registry_client_ssl)
        tcp_bus = TCPBus(registry_client)
        registry_client.conn_handler = tcp_bus
        # pubsub_bus = PubSubBus(registry_client, ssl_context=cls._tcp_service._ssl_context)
        pubsub_bus = PubSubBus(
            registry_client)  # , cls._tcp_service._ssl_context)

        registry_client.bus = tcp_bus
        if isinstance(service, TCPService):
            tcp_bus.tcp_host = service
        if isinstance(service, HTTPService):
            tcp_bus.http_host = service
        service.tcp_bus = tcp_bus
        service.pubsub_bus = pubsub_bus