def stop(self):
     from services import driver
     from main import events
     from transport.proxy import proxy_router
     events.remove_subscriber(self._on_dht_layer_connected,
                              'dht-layer-connected')
     proxy_router.A('stop')
     proxy_router.A('shutdown')
     if driver.is_on('service_entangled_dht'):
         from dht import dht_service
         from dht import dht_records
         dht_service.suspend(layer_id=dht_records.LAYER_PROXY_ROUTERS)
     return True
 def start(self):
     from logs import lg
     from services import driver
     from main import events
     from transport.proxy import proxy_router
     proxy_router.A('init')
     proxy_router.A('start')
     if driver.is_on('service_entangled_dht'):
         self._do_connect_proxy_routers_dht_layer()
     else:
         lg.warn('service service_entangled_dht is OFF')
     events.add_subscriber(self._on_dht_layer_connected,
                           'dht-layer-connected')
     return True
 def cancel(self, json_payload, newpacket, info):
     from transport.proxy import proxy_router
     proxy_router.A('cancel-route-received', (
         json_payload,
         newpacket,
         info,
     ))
     return True
예제 #4
0
 def cancel(self, request, info):
     from transport.proxy import proxy_router
     proxy_router.A('cancel-route', (request, info))
     return None
예제 #5
0
 def request(self, request, info):
     from transport.proxy import proxy_router
     proxy_router.A('request-route', (request, info))
     return None
예제 #6
0
 def stop(self):
     from transport.proxy import proxy_router
     proxy_router.A('stop')
     proxy_router.A('shutdown')
     return True
예제 #7
0
 def start(self):
     from transport.proxy import proxy_router
     proxy_router.A('init')
     proxy_router.A('start')
     return True