oid_from now accepts threads argument that if set to false does not use get_ident()

This commit is contained in:
Ask Solem 2016-10-13 14:31:01 -07:00
parent c457a88459
commit 42c8b17d49
1 changed files with 7 additions and 2 deletions

View File

@ -53,8 +53,13 @@ def generate_oid(node_id, process_id, thread_id, instance):
return str(uuid3(NAMESPACE_OID, ent))
def oid_from(instance):
return generate_oid(get_node_id(), os.getpid(), get_ident(), instance)
def oid_from(instance, threads=True):
return generate_oid(
get_node_id(),
os.getpid(),
get_ident() if threads else 0,
instance,
)
class Broadcast(Queue):