amachine.am_id_generator
1import itertools 2import threading 3 4_lock = threading.Lock() 5_composition_counter = itertools.count(0) 6_group_counter = itertools.count(0) 7 8def next_composition_id() -> str: 9 with _lock: 10 return str( next(_composition_counter) ) 11 12def next_group_id() -> str: 13 with _lock: 14 return str( next(_group_counter) )
def
next_composition_id() -> str:
def
next_group_id() -> str: