Select Git revision
-
semantic-release-bot authored
# [1.6.0](https://github.com/saltstack-formulas/php-formula/compare/v1.5.1...v1.6.0) (2022-03-14) ### Continuous Integration * update linters to latest versions [skip ci] ([8befefcf](https://github.com/saltstack-formulas/php-formula/commit/8befefcfbe50378691cf199f900cf2ca8ba4339f)) * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] ([4f544745](https://github.com/saltstack-formulas/php-formula/commit/4f5447451d28137f488bcb20313d6c30fe3e9dd8)) * **kitchen+ci:** update with `3004` pre-salted images/boxes [skip ci] ([def69936](https://github.com/saltstack-formulas/php-formula/commit/def69936b47bfd0e65e521a3b2629b591e2a11ca)) * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] ([ded03de0](https://github.com/saltstack-formulas/php-formula/commit/ded03de05e777a4c3b0a1aad8de650470c244d6a)) * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([2e98aed8](https://github.com/saltstack-formulas/php-formula/commit/2e98aed831e0adcfdc7f34df7c29529614a4ce0e)) * **vagrant:** replace FreeBSD 12.2 with 12.3 [skip ci] ([4e5af987](https://github.com/saltstack-formulas/php-formula/commit/4e5af9875abd9e4149db2d3e10c9f6dfcca435f2)) ### Features * **modules:** add `xmlrpc` and `xmlreader` as FreeBSD `xml` module ([67e565f5](https://github.com/saltstack-formulas/php-formula/commit/67e565f5e2ce83c26a79267f25317e6e4340a73e)) ### Tests * **system:** add `build_platform_codename` [skip ci] ([f1592024](https://github.com/saltstack-formulas/php-formula/commit/f1592024d507873415debcdc03aa2c885af2e4cf))
semantic-release-bot authored# [1.6.0](https://github.com/saltstack-formulas/php-formula/compare/v1.5.1...v1.6.0) (2022-03-14) ### Continuous Integration * update linters to latest versions [skip ci] ([8befefcf](https://github.com/saltstack-formulas/php-formula/commit/8befefcfbe50378691cf199f900cf2ca8ba4339f)) * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] ([4f544745](https://github.com/saltstack-formulas/php-formula/commit/4f5447451d28137f488bcb20313d6c30fe3e9dd8)) * **kitchen+ci:** update with `3004` pre-salted images/boxes [skip ci] ([def69936](https://github.com/saltstack-formulas/php-formula/commit/def69936b47bfd0e65e521a3b2629b591e2a11ca)) * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] ([ded03de0](https://github.com/saltstack-formulas/php-formula/commit/ded03de05e777a4c3b0a1aad8de650470c244d6a)) * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([2e98aed8](https://github.com/saltstack-formulas/php-formula/commit/2e98aed831e0adcfdc7f34df7c29529614a4ce0e)) * **vagrant:** replace FreeBSD 12.2 with 12.3 [skip ci] ([4e5af987](https://github.com/saltstack-formulas/php-formula/commit/4e5af9875abd9e4149db2d3e10c9f6dfcca435f2)) ### Features * **modules:** add `xmlrpc` and `xmlreader` as FreeBSD `xml` module ([67e565f5](https://github.com/saltstack-formulas/php-formula/commit/67e565f5e2ce83c26a79267f25317e6e4340a73e)) ### Tests * **system:** add `build_platform_codename` [skip ci] ([f1592024](https://github.com/saltstack-formulas/php-formula/commit/f1592024d507873415debcdc03aa2c885af2e4cf))
README.md 3.73 KiB
pikatasks
pikatasks is a minimalistic library that allows you to run remote tasks easily. There's also a Django integration.
Requirements
pip install pika
- RabbitMQ as message broker
How-to
Import:
import pikatasks
Configure:
pikatasks.settings.BROKER_HOST = "localhost"
pikatasks.settings.BROKER_PORT = 5672 # change to 5671 if using SSL
pikatasks.settings.SSL_ENABLED = False # change to True in production :)
pikatasks.settings.VIRTUAL_HOST = "/" # rabbitmq default vhost
pikatasks.settings.USERNAME = "admin" # too lazy to change!
pikatasks.settings.PASSWORD = "qwertz" # easy to remember!
Or in Django settings:
PIKATASKS_BROKER_HOST = "localhost"
PIKATASKS_BROKER_PORT = 5672
...
Implement a task (server):
@pikatasks.task
def hello(something):
msg = "Hello, " + something + "!"
print(msg)
return msg
- The task name (and the queue name) will be the same as the function name. If you want to specify a custom task (and queue) name, use
@pikatasks.task("my_task_name")
. - Note: you will need a queue with exactly the same name as the task. See section: Queues and Permissions.
Start a server:
pikatasks.worker.start(tasks=[hello])
Run a task (client):
To simply run a task:
pikatasks.run("hello", something="World")
Run a task and get its result: