Skip to main content

celery_context

Documentation

The documentation is hosted at https://github.com/BingerYang/celery_context

Installation

pip install celery_context

Usage

example:

# -*- coding: utf-8 -*-
from flask import Flask
from celery_context import Celery
from flask import request

config = dict(redis={"host": "*****", "port": 31320, "password": "lab@2019"})
redis_url = "redis://:{password}@{host}:{port}".format(**config["redis"])
app = Flask("example.run")
app.config['CELERY_BROKER_URL'] = "{}/1".format(redis_url)
app.config['CELERY_RESULT_BACKEND'] = "{}/2".format(redis_url)
celery = Celery(app=app)
celery.setup_task_context(lambda: dict(path=request.path))


@celery.task(bind=True)
def add(self, a, b):
    print("a+ n:", a + b, self.request.content)
    return a + b


@app.route("/")
def index():
    ret = add.delay(1, 3)
    print(ret.get())
    return ret.id


if __name__ == "__main__":
    app.run()

Metadata

Release files for celery-context 0.0.2.20052710

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celery-context 0.0.2.20052710
File Size Uploaded Provenance
celery_context-0.0.2.20052710.tar.gz 4.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for celery-context 0.0.2.20052710
File Interpreter ABI Platform
celery_context-0.0.2.20052710-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / celery_context-0.0.2.20052710.tar.gz

Download URL celery_context-0.0.2.20052710.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f9b020a0393dd0c4b6f09a1f0c1226499222f33f2dfee0aee0a758350c880191
BLAKE2b-256 checksum
How to use checksums
a14be24ce8a5c707487616ba0bdb30f0af269cb43bc636b347bb41763d8a8385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / celery_context-0.0.2.20052710-py3-none-any.whl

Download URL celery_context-0.0.2.20052710-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7dfc0c62d384e32b8f610b33b96b4307f7eedee0e2e29cf8c0d15d62fac396f
BLAKE2b-256 checksum
How to use checksums
cd6fa9828b941bfda908d0877c77ff8ad2212b9cf3bfe478a420022af0c78839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Security for celery-context 0.0.2.20052710

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page