celery.worker.consumer
¶
Worker consumer.
- class celery.worker.consumer.Agent(c, **kwargs)[исходный код]¶
Agent starts cell actors.
- conditional = True¶
- create(c)[исходный код]¶
Create the step.
- name = 'celery.worker.consumer.agent.Agent'¶
- requires = (step:celery.worker.consumer.connection.Connection{()},)¶
- class celery.worker.consumer.Connection(c, **kwargs)[исходный код]¶
Service managing the consumer broker connection.
- info(c)[исходный код]¶
- name = 'celery.worker.consumer.connection.Connection'¶
- shutdown(c)[исходный код]¶
- start(c)[исходный код]¶
- class celery.worker.consumer.Consumer(on_task_request, init_callback=<function noop>, hostname=None, pool=None, app=None, timer=None, controller=None, hub=None, amqheartbeat=None, worker_options=None, disable_rate_limits=False, initial_prefetch_count=2, prefetch_multiplier=1, **kwargs)[исходный код]¶
Consumer blueprint.
- class Blueprint(steps=None, name=None, on_start=None, on_close=None, on_stopped=None)[исходный код]¶
Consumer blueprint.
- default_steps = ['celery.worker.consumer.connection:Connection', 'celery.worker.consumer.mingle:Mingle', 'celery.worker.consumer.events:Events', 'celery.worker.consumer.gossip:Gossip', 'celery.worker.consumer.heart:Heart', 'celery.worker.consumer.control:Control', 'celery.worker.consumer.tasks:Tasks', 'celery.worker.consumer.consumer:Evloop', 'celery.worker.consumer.agent:Agent']¶
- name = 'Consumer'¶
- shutdown(parent)[исходный код]¶
- add_task_queue(queue, exchange=None, exchange_type=None, routing_key=None, **options)[исходный код]¶
- apply_eta_task(task)[исходный код]¶
Method called by the timer to apply a task with an ETA/countdown.
- bucket_for_task(type)[исходный код]¶
- call_soon(p, *args, **kwargs)[исходный код]¶
- cancel_task_queue(queue)[исходный код]¶
- connect()[исходный код]¶
Establish the broker connection used for consuming tasks.
Retries establishing the connection if the
broker_connection_retry
setting is enabled
- connection_for_read(heartbeat=None)[исходный код]¶
- connection_for_write(heartbeat=None)[исходный код]¶
- create_task_handler(promise=<class 'vine.promises.promise'>)[исходный код]¶
- ensure_connected(conn)[исходный код]¶
- init_callback = None¶
Optional callback called the first time the worker is ready to receive tasks.
- loop_args()[исходный код]¶
- property max_prefetch_count¶
- on_close()[исходный код]¶
- on_connection_error_after_connected(exc)[исходный код]¶
- on_connection_error_before_connected(exc)[исходный код]¶
- on_decode_error(message, exc)[исходный код]¶
Callback called if an error occurs while decoding a message.
Simply logs the error and acknowledges the message so it doesn’t enter a loop.
- Параметры:
message (kombu.Message) – The message received.
exc (Exception) – The exception being handled.
- on_invalid_task(body, message, exc)[исходный код]¶
- on_ready()[исходный код]¶
- on_send_event_buffered()[исходный код]¶
- on_unknown_message(body, message)[исходный код]¶
- on_unknown_task(body, message, exc)[исходный код]¶
- perform_pending_operations()[исходный код]¶
- pool = None¶
The current worker pool instance.
- register_with_event_loop(hub)[исходный код]¶
- reset_rate_limits()[исходный код]¶
- restart_count = -1¶
- shutdown()[исходный код]¶
- start()[исходный код]¶
- stop()[исходный код]¶
- timer = None¶
A timer used for high-priority internal tasks, such as sending heartbeats.
- update_strategies()[исходный код]¶
- class celery.worker.consumer.Control(c, **kwargs)[исходный код]¶
Remote control command service.
- include_if(c)[исходный код]¶
Return true if bootstep should be included.
You can define this as an optional predicate that decides whether this step should be created.
- name = 'celery.worker.consumer.control.Control'¶
- requires = (step:celery.worker.consumer.tasks.Tasks{(step:celery.worker.consumer.mingle.Mingle{(step:celery.worker.consumer.events.Events{(step:celery.worker.consumer.connection.Connection{()},)},)},)},)¶
- class celery.worker.consumer.Events(c, task_events=True, without_heartbeat=False, without_gossip=False, **kwargs)[исходный код]¶
Service used for sending monitoring events.
- name = 'celery.worker.consumer.events.Events'¶
- requires = (step:celery.worker.consumer.connection.Connection{()},)¶
- shutdown(c)[исходный код]¶
- start(c)[исходный код]¶
- stop(c)[исходный код]¶
- class celery.worker.consumer.Gossip(c, without_gossip=False, interval=5.0, heartbeat_interval=2.0, **kwargs)[исходный код]¶
Bootstep consuming events from other workers.
This keeps the logical clock value up to date.
- call_task(task)[исходный код]¶
- compatible_transport(app)[исходный код]¶
- compatible_transports = {'amqp', 'redis'}¶
- election(id, topic, action=None)[исходный код]¶
- get_consumers(channel)[исходный код]¶
- label = 'Gossip'¶
- name = 'celery.worker.consumer.gossip.Gossip'¶
- on_elect(event)[исходный код]¶
- on_elect_ack(event)[исходный код]¶
- on_message(prepare, message)[исходный код]¶
- on_node_join(worker)[исходный код]¶
- on_node_leave(worker)[исходный код]¶
- on_node_lost(worker)[исходный код]¶
- periodic()[исходный код]¶
- register_timer()[исходный код]¶
- requires = (step:celery.worker.consumer.mingle.Mingle{(step:celery.worker.consumer.events.Events{(step:celery.worker.consumer.connection.Connection{()},)},)},)¶
- start(c)[исходный код]¶
- class celery.worker.consumer.Heart(c, without_heartbeat=False, heartbeat_interval=None, **kwargs)[исходный код]¶
Bootstep sending event heartbeats.
This service sends a
worker-heartbeat
message every n seconds.Примечание
Not to be confused with AMQP protocol level heartbeats.
- name = 'celery.worker.consumer.heart.Heart'¶
- requires = (step:celery.worker.consumer.events.Events{(step:celery.worker.consumer.connection.Connection{()},)},)¶
- shutdown(c)¶
- start(c)[исходный код]¶
- stop(c)[исходный код]¶
- class celery.worker.consumer.Mingle(c, without_mingle=False, **kwargs)[исходный код]¶
Bootstep syncing state with neighbor workers.
At startup, or upon consumer restart, this will:
Sync logical clocks.
Sync revoked tasks.
- compatible_transport(app)[исходный код]¶
- compatible_transports = {'amqp', 'redis'}¶
- label = 'Mingle'¶
- name = 'celery.worker.consumer.mingle.Mingle'¶
- on_clock_event(c, clock)[исходный код]¶
- on_node_reply(c, nodename, reply)[исходный код]¶
- on_revoked_received(c, revoked)[исходный код]¶
- requires = (step:celery.worker.consumer.events.Events{(step:celery.worker.consumer.connection.Connection{()},)},)¶
- send_hello(c)[исходный код]¶
- start(c)[исходный код]¶
- sync(c)[исходный код]¶
- sync_with_node(c, clock=None, revoked=None, **kwargs)[исходный код]¶
- class celery.worker.consumer.Tasks(c, **kwargs)[исходный код]¶
Bootstep starting the task message consumer.
- info(c)[исходный код]¶
Return task consumer info.
- name = 'celery.worker.consumer.tasks.Tasks'¶
- requires = (step:celery.worker.consumer.mingle.Mingle{(step:celery.worker.consumer.events.Events{(step:celery.worker.consumer.connection.Connection{()},)},)},)¶
- shutdown(c)[исходный код]¶
Shutdown task consumer.
- start(c)[исходный код]¶
Start task consumer.
- stop(c)[исходный код]¶
Stop task consumer.