zulip/zerver/lib/handlers.py

13 lines
285 B
Python
Raw Normal View History

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