BSD Ports

devel/py-celery-singleton 0.3.1_1 FreeBSD

Prevent duplicate celery tasks

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
License
MIT
Categories
devel, python
Package size
13.0 KiB, 42.7 KiB installed

Description

celery-singleton uses the JSON representation of a task's delay() or apply_async() arguments to generate a unique lock and stores it in redis. By default it uses the redis server of the celery result backend. If you use a different/no result backend or want to use a different redis server for celery-singleton, refer the configuration section for how to customize the redis.

import time from celery_singleton import Singleton from somewhere import celery_app

@celery_app.task(base=Singleton) def do_stuff(*args, **kwargs): time.sleep(4) return 'I just woke up'

# run the task as normal async_result = do_stuff.delay(1, 2, 3, a='b') async_result2 = do_stuff.delay(1, 2, 3, a='b')

# These are the same, task is only queued once assert async_result == async_result2

In the other systems

SystemPortVersion
FreeBSDdevel/py-celery-singleton0.3.1_1
DragonFlydevel/py-celery-singleton0.3.1_1

Install

Binary package:

pkg install py312-celery-singleton

From the ports tree:

cd /usr/ports/devel/py-celery-singleton/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	py312-celery-singleton>0:devel/py-celery-singleton

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest0.3.1_10.3.1_1-0.3.1_10.3.1_1
FreeBSD:14:quarterly0.3.1_10.3.1_1n/a0.3.1_10.3.1_1
FreeBSD:15:latest0.3.1_10.3.1_1n/a0.3.1_10.3.1_1
FreeBSD:15:quarterly0.3.1_10.3.1_1n/an/an/a
FreeBSD:16:latest0.3.1_10.3.1_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Runtime 1

The full lists below include those, and their dependencies in turn.

Build dependencies 10
Run dependencies 8

No port depends on this one.

Configuration

No options to configure.

USES
python:run
Service scripts
none

Files

distinfo 1
FileSizeSHA256
celery-singleton-0.3.1.tar.gz4659260ce4978e631f8682ea0ccb03d7f3b87d42bc20e04e9bd46ddb78a2f8035d1e
Master sites 1
  • PYPI

Commit history 0

No commits in the history this site was built from.