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.3.21030419

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.3.21030419
File Size Uploaded Provenance
celery_context-0.0.3.21030419.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 8.9 kB

Release files / celery_context-0.0.3.21030419.tar.gz

Download URL celery_context-0.0.3.21030419.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
984c7238f33816581b9d031d89ab3eb50a9456d7690a60aca73a06f98fa339e5
BLAKE2b-256 checksum
How to use checksums
1169a85d7e8403ae295837ff4728c5df4bc3df451be46ba0c8123ed330c21926
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.7

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

Download URL celery_context-0.0.3.21030419-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff14c1e1caf199dd395bf4c519d6e31348411d9a90b8de152c87b80141e3c43f
BLAKE2b-256 checksum
How to use checksums
d54d1c405f4d45fa2c556147b813d7d997dda25cc135d27657b9147bff8d0cf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.7

Security for celery-context 0.0.3.21030419

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