This document describes the current stable version of Celery (3.1). For development docs, go here.

celery.concurrency.base

celery.concurrency.base

TaskPool interface.

class celery.concurrency.base.BasePool(limit=None, putlocks=True, forking_enable=True, callbacks_propagate=(), **options)[source]
CLOSE = 2
RUN = 1
TERMINATE = 3
class Timer(schedule=None, on_error=None, on_tick=None, on_start=None, max_interval=None, **kwargs)
class Entry(fun, args=None, kwargs=None)
args
cancel()
cancelled
fun
kwargs
tref
Schedule

alias of Timer

call_after(*args, **kwargs)
call_at(*args, **kwargs)
call_repeatedly(*args, **kwargs)
cancel(tref)
clear()
empty()
ensure_started()
enter(entry, eta, priority=None)
enter_after(*args, **kwargs)
exit_after(secs, priority=10)
next()
on_tick = None
queue
run()
running = False
stop()
active
apply_async(target, args=[], kwargs={}, **options)[source]

Equivalent of the apply() built-in function.

Callbacks should optimally return as soon as possible since otherwise the thread which handles the result will get blocked.

close()[source]
did_start_ok()[source]
flush()[source]
info
is_green = False

set to true if pool uses greenlets.

maintain_pool(*args, **kwargs)[source]
num_processes
on_apply(*args, **kwargs)[source]
on_close()[source]
on_hard_timeout(job)[source]
on_soft_timeout(job)[source]
on_start()[source]
on_stop()[source]
on_terminate()[source]
register_with_event_loop(loop)[source]
restart()[source]
signal_safe = True

set to true if the pool can be shutdown from within a signal handler.

start()[source]
stop()[source]
task_join_will_block = True
terminate()[source]
terminate_job(pid, signal=None)[source]
uses_semaphore = False

only used by multiprocessing pool

celery.concurrency.base.apply_target(target, args=(), kwargs={}, callback=None, accept_callback=None, pid=None, getpid=<built-in function getpid>, propagate=(), monotonic=<function _monotonic>, **_)[source]