utils.nodenames

Worker name utilities.

Module Contents

Functions

worker_direct(hostname) Return the kombu.Queue being a direct route to a worker.
nodename(name,hostname) Create node name from name/hostname pair.
anon_nodename(hostname=None,prefix=”gen”) Return the nodename for this process (not a worker).
nodesplit(name) Split node name into tuple of name/hostname.
default_nodename(hostname) Return the default nodename for this process.
node_format(s,name,**extra) Format worker node name (name@host.com).
_fmt_process_index(prefix=”“,default=”0”)
host_format(s,host=None,name=None,**extra) Format host %x abbreviations.
worker_direct(hostname)

Return the kombu.Queue being a direct route to a worker.

Arguments:
hostname (str, ~kombu.Queue): The fully qualified node name of
a worker (e.g., w1@example.com). If passed a kombu.Queue instance it will simply return that instead.
nodename(name, hostname)

Create node name from name/hostname pair.

anon_nodename(hostname=None, prefix="gen")

Return the nodename for this process (not a worker).

This is used for e.g. the origin task message field.

nodesplit(name)

Split node name into tuple of name/hostname.

default_nodename(hostname)

Return the default nodename for this process.

node_format(s, name, **extra)

Format worker node name (name@host.com).

_fmt_process_index(prefix="", default="0")
host_format(s, host=None, name=None, **extra)

Format host %x abbreviations.