8.1.1.11. extend

Dispatcher.extend(*blues, memo=None)[source]

Extends Dispatcher calling each deferred operation of given Blueprints.

Parameters:
  • blues (Blueprint | schedula.dispatcher.Dispatcher) – Blueprints or Dispatchers to extend deferred operations.
  • memo (dict[T,schedula.utils.blue.Blueprint|Dispatcher]) – A dictionary to cache Blueprints and Dispatchers.
Returns:

Self.

Return type:

Dispatcher

——————————————————————–

Example:

>>> import schedula as sh
>>> dsp = sh.Dispatcher()
>>> dsp.add_func(callable, ['is_callable'])
'callable'
>>> blue = sh.BlueDispatcher().add_func(len, ['length'])
>>> dsp = sh.Dispatcher().extend(dsp, blue)

digraph dmap { graph [ratio=1] node [style=filled] label = <dmap> splines = ortho style = filled 91 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-6f54a9a1fc34ec4cac90217702e246dd6bab3bed/callable.html">callable</TD></TR></TABLE>> fillcolor=springgreen id=0 shape=box tooltip="\"Return whether the object is callable (i.e., some kind of function).\""] 92 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">is_callable</TD></TR></TABLE>> fillcolor=cyan id=4 shape=box style="rounded,filled" tooltip="\"is_callable\""] 93 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2" href="./dispatcher-6f54a9a1fc34ec4cac90217702e246dd6bab3bed/len.html">len</TD></TR></TABLE>> fillcolor=springgreen id=5 shape=box tooltip="\"Return the number of items in a container.\""] 94 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">length</TD></TR></TABLE>> fillcolor=cyan id=6 shape=box style="rounded,filled" tooltip="\"length\""] 95 [label=<<TABLE border="0" cellspacing="0"><TR><TD border="0" colspan="2">obj</TD></TR></TABLE>> fillcolor=cyan id=3 shape=box style="rounded,filled" tooltip="\"obj\""] 91 -> 92 95 -> 91 95 -> 93 93 -> 94 }