Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/celery.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
****************************************
Running with Celery
****************************************

To use this client with Celery, call the `initialize_client` method in the `worker_process_init` event. If you don't initialize the client inside the `worker_process_init` event, the client will not poll for updates. As such, the client will not update its feature toggles, even when changes are made server side.

.. code-block:: python

from UnleashClient import UnleashClient
from celery.signals import worker_process_init

client = UnleashClient(
url="http://localhost:4242/api/",
app_name="test-dev",
custom_headers={'Authorization': '*:development.bb09e81624d5ad67b2ac29bd0b0fdc35ccbac884e63cfd20c6fefc49'})

@worker_process_init.connect
def configure_workers(sender=None, conf=None, **kwargs):
client.initialize_client()
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Documentation for Unleash's Python client. See the sidebar for more topics!
customcache
development
wsgi
celery

.. toctree::
:caption: API Documentation
Expand Down