MCPcopy
hub / github.com/celery/celery / anon_nodename

Function anon_nodename

celery/utils/nodenames.py:61–66  ·  view source on GitHub ↗

Return the nodename for this process (not a worker). This is used for e.g. the origin task message field.

(hostname: str | None = None, prefix: str = 'gen')

Source from the content-addressed store, hash-verified

59
60
61def anon_nodename(hostname: str | None = None, prefix: str = 'gen') -> str:
62 """Return the nodename for this process (not a worker).
63
64 This is used for e.g. the origin task message field.
65 """
66 return nodename(''.join([prefix, str(os.getpid())]), hostname or gethostname())
67
68
69def nodesplit(name: str) -> tuple[None, str] | list[str]:

Callers 5

test_inspect.pyFile · 0.90
embed_workerFunction · 0.90
_start_worker_threadFunction · 0.90
as_task_v2Method · 0.90
__init__Method · 0.90

Calls 2

nodenameFunction · 0.85
joinMethod · 0.45

Tested by 1

embed_workerFunction · 0.72