Added logic to close routes
Not called on close() yet because of server/client inconsistencies
This commit is contained in:
parent
c43ed25410
commit
4eae2567ad
1 changed files with 12 additions and 4 deletions
|
@ -60,6 +60,9 @@ class Route:
|
||||||
def start(self, handler):
|
def start(self, handler):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def stop(self, handler):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Pipe(Route):
|
class Pipe(Route):
|
||||||
def run(self, data, peer, handler):
|
def run(self, data, peer, handler):
|
||||||
|
@ -82,6 +85,14 @@ def launch_routes(created_routes, handler):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def close_routes(created_routes, handler):
|
||||||
|
for prefix in created_routes:
|
||||||
|
try:
|
||||||
|
created_routes[prefix].stop(handler)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def create_exchange_map(routes):
|
def create_exchange_map(routes):
|
||||||
exchange_map = {0 : META_ROUTE}
|
exchange_map = {0 : META_ROUTE}
|
||||||
exchange_id = 1
|
exchange_id = 1
|
||||||
|
@ -160,9 +171,6 @@ class DummyPipe(Route):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Message packing and unpacking
|
# Message packing and unpacking
|
||||||
def create_metadata(data_type, converted_route, indexed_dict=False):
|
def create_metadata(data_type, converted_route, indexed_dict=False):
|
||||||
return struct.pack(PACK_FORMAT,
|
return struct.pack(PACK_FORMAT,
|
||||||
|
|
Reference in a new issue