gwcelery.tasks.core module

Base classes for other Celery tasks.

(task)gwcelery.tasks.core.identity(arg=None)[source]

Identity task (returns its input).

(task)gwcelery.tasks.core.get_first(args)[source]

Get the first result of a group. Identity for scalar

(task)gwcelery.tasks.core.get_last(args)[source]

Get the last result of a group. Identity for scalar

class gwcelery.tasks.core.DispatchHandler[source]

Bases: dict

process_args(*args, **kwargs)[source]

Determine key and callback arguments.

The default implementation treats the first positional argument as the key.

Parameters:
  • *args – Arguments passed to __call__().

  • **kwargs – Keyword arguments passed to __call__().

Returns:

  • key – The key to determine which callback to invoke.

  • *args – The arguments to pass to the registered callback.

  • **kwargs – The keyword arguments to pass to the registered callback.

dispatch(*args, **kwargs)[source]