Rocket task manager
Asynchronous task manager in python
Install
pip install rockettm
Link pypi: https://pypi.python.org/pypi/rockettm
Example
Redis not is localhost
from rockettm import connect
# to run it, reconnect to Redis
connect("other_ip_or_domain")
Configure logger in client
Using standard logger in python https://docs.python.org/2/library/logging.html#logging.basicConfig
import logging
from rockettm import send_task
# 50 CRITICAL, 40 ERROR, 30 WARNING, 20 INFO, 10 DEBUG, 0 NOTSET
logging.basicConfig(level=20)
send_task("queue_name", "name_task", "Pepito")
Configure logger in server
in settings.py:
# filename (DEFAULT "rockettm.log")
# level (DEFAULT 30)
# 50 CRITICAL, 40 ERROR, 30 WARNING, 20 INFO, 10 DEBUG, 0 NOTSET
logger = {'filename': "rockettm.log", # optional,
# is not defined print in console
'level': 10 # optional
}
Send task
# send task
from rockettm import send_task
send_task("queue_name", "name_task", "arg1", ["arg2", "2"], {'args': 3}, ('arg', 4), example="ok")
Declare new task
Warning! if there are 2 tasks registered with the same name, will run 2!
# task example
from rockettm import task
@task('name_task')
def function1(*args, **kwargs):
return True
# max_time(timeout in seconds) example
@task('name_task2', max_time=10)
def long_call(*args, **kwargs):
return True
settings.py example
# settings.py example
ip = "127.0.0.1"
port = 5672
logger = {'filename': "rockettm.log", # optional,
# is not defined print in console
'level': 10 # optional
}
# search @task in imports
imports = ['examples.test1',
'examples.test2']
# support params
# name (mandatory), string
# concurrency (mandatory), int
# durable (optional), boolean
# max_time (in seconds) (optional), int
queues = [{'name': 'rocket1', 'durable': True, 'concurrency': 7},
{'name': 'rocket2', 'concurrency': 1},
{'name': 'rocket3', 'concurrency': 1, 'max_time': 10}]
Run server
rockettm_server file_settings.py
Documentation
Functions
task(name_task_event)
It is a decorator to create tasks
send_task(queue, name_task, *args)
Send task
add_task(name_task, func(object))
Add manual task
connect(ip_or_domain)
connects to another server other than localhost
Basicevents
rockettm currently used basicevents for noticificaciones the api. You can use basicevents as its official documentation *
Do not need to run(), rockettm up a common process for all workers
CHANGELOG
2.2.13 (2017-05-16)
remove prints …
2.2.12 (2017-05-16)
fix gevent incompatibility (timekiller)
2.2.11 (2017-05-11)
fix gevent incompatibility
2.2.10 (2017-04-24)
qsize support name and namespace arguments
empty support name and namespace arguments
2.2.9 (2017-04-19)
only support ujson
fix serializer
2.2.8 (2017-04-19)
fix import
2.2.4 (2017-04-19)
fix dependencies
2.2.3 (2017-04-07)
Graceful stop
2.2.2 (2017-03-31)
support force exit
2.2.1 (2017-03-31)
sigterm safe
2.2.0 (2017-03-18)
callback is optional
return callback to rabbitmq (queue results)
Support return other results to basicevents (send(“results”, “type”, “data”))
2.1.11 (2016-12-12)
Fix dependencies conflict
2.1.11 (2016-11-02)
Fix dependencies conflict
2.1.10 (2016-10-20)
Clean code
2.1.9 (2016-10-19)
prevent infinite callback
2.1.6 (2016-09-29)
send return False with failed send
2.1.5 (2016-09-29)
Fix name var
2.1.4 (2016-09-29)
Support custom id
2.1.3 (2016-09-28)
Supported basicevents
2.1.2 (2016-09-28)
Fix dead MainThread in Python 3.4.2
2.1.1 (2016-09-21)
clean code
2.1.0 (2016-09-21)
call api in init tasks and return status task
2.0.6 (2016-09-20)
added support kwargs in tasks
2.0.5 (2016-09-07)
Revert heartbeat
2.0.4 (2016-09-07)
implemented heartbeat
fix ack failed for loss connection
2.0.3 (2016-09-07)
prevent relaunch finish task
2.0.2 (2016-09-07)
Change prefetch to 1
2.0.1 (2016-09-06)
Reuse connection in send_tasks
2.0.0 (2016-09-06)
Migrate pika to kambu
1.0.16 (2016-09-06)
Fix ack
1.0.8 - 1.0.15 (2016-09-06)
clean code
1.0.8 - 1.0.13 (2016-09-05)
fix timeouts and other exceptions
1.0.7 (2016-09-05)
fix rabbitmq ack timeout
1.0.6 (2016-08-26)
retry sending the message to the queue 5 times before returning an exception
When you add in the queue fails, now returns an exception
1.0.5 (2016-08-26)
timekiller stop propagate
fix inmortal server
1.0.4 (2016-08-25)
run tasks in safe and isolated proccess
1.0.3 (2016-08-25)
Solved multiple errors with disconnection with RabbitMQ
Update python compatibility (py2.x no loger supported)
1.0.2 (2016-08-23)
Fix automatic declare queues
1.0.1 (2016-08-22)
send_task now sends the set ip
1.0.0 (2016-07-19)
Added callback support
generate uuid for task
all tasks get _id in first attr
if multiple tasks with the same name, if continued with the following fails
prevent connection closed to send_task (automatic reconnect)
0.2.6 (2016-07-15)
py3 compatibility
fix hardcoding durable
ignore not exists logger config
0.2.5 (2016-07-15)
py3 compatibility
0.2.4 (2016-07-15)
Fix automatic declare queue
0.2.3 (2016-06-14)
Add new dependency (timekiller)
0.2.2 (2016-06-14)
hotfix bad raise
0.2.1 (2016-06-14)
Hotfix rabbitmq_server command
0.2.0 (2016-06-13)
add support timeout (tasks and queues)
0.1.1 (2016-04-27)
Fix dependencies
0.1.0 (2016-03-22)
Permit change log
0.0.4 (2016-03-21)
Fix CHANGELOG
Update README
0.0.3 (2016-03-21)
Permit connect different rabbitmq server
Prevent channel_closed
Support durable queues
0.0.2 (2016-03-14)
Add documentation
0.0.1 (2016-03-14)
initial version
Metadata
Release files for rockettm 2.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rockettm-2.2.14.tar.gz | 7.1 kB | Without provenance | Details for rockettm-2.2.14.tar.gz |
Release files / rockettm-2.2.14.tar.gz
| Download URL | rockettm-2.2.14.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4aeb0a13126530223f01e3e4f4fe6484d94f1d47bf5ef3ab0ed2d5e0f1c0464f
|
|
BLAKE2b-256 checksum How to use checksums |
ec8a2806e46b741b515bd1e46e4de06187c50d19094defde9c4b4ee7ade58de8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rockettm 2.2.14
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.