mirror of https://github.com/zulip/zulip.git
13 lines
285 B
Python
13 lines
285 B
Python
|
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
|