mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 22:48:16 +00:00
Track Tornado handlers by uniquely assigned IDs rather than objects.
This is early preparation for splitting apart Tornado into a queue server and a frontend server.
This commit is contained in:
12
zerver/lib/handlers.py
Normal file
12
zerver/lib/handlers.py
Normal file
@@ -0,0 +1,12 @@
|
||||
current_handler_id = 0
|
||||
handlers = {}
|
||||
|
||||
def get_handler_by_id(handler_id):
|
||||
return handlers[handler_id]
|
||||
|
||||
def allocate_handler_id(handler):
|
||||
global current_handler_id
|
||||
handlers[current_handler_id] = handler
|
||||
ret = current_handler_id
|
||||
current_handler_id += 1
|
||||
return ret
|
||||
Reference in New Issue
Block a user