Skip to main content

expand_dest

Expands the destination by attempting to unpack the return value into an exchange and routing key, falling back to the provided defaults if unpacking fails.

def expand_dest(
ret: any,
exchange: string,
routing_key: string
) - > tuple

Determines the final exchange and routing key by attempting to unpack a return value or falling back to provided defaults.

Parameters

NameTypeDescription
retanyThe primary source for destination details, expected to be an unpackable sequence of (exchange, routing_key).
exchangestringThe default exchange name to use if the ret parameter cannot be unpacked.
routing_keystringThe default routing key to use if the ret parameter cannot be unpacked.

Returns

TypeDescription
tupleA tuple containing the resolved exchange name and routing key string.