No project description provided
Project description
Queue Worker
The Queue Worker is a Python script designed to execute tasks from a queue with specified parameters.
It allows you to control the delay between task executions and choose which action IDs to process.
This README provides instructions on how to use the Queue Worker.
Preparation Steps
- Ensure the desired action is listed in the
action_table
within theaction
database. - If not, add
filename
(e.g.,send_message.py
),function_module
(e.g.,SendSMS
or leave it null), andfunction_name
(e.g.,send_sms
) to theaction_table
. - Note that the Queue Worker currently only handles Python functions. For other languages, please create a Jira issue.
Usage
python queue_worker.py -min_delay_after_execution <min_interval> -max_delay_after_execution <max_interval> -action_ids <action_ids>
Replace <min_interval>, <max_interval>
with the min and time in milliseconds, and <action_ids>
with the list of action IDs you want to execute.
Example:
Here's an example of how to use the Queue Worker with custom parameters:
python queue_worker.py -min_delay_after_execution 0.5 -max_delay_after_execution 1.2 -action_ids 1 2 4
This command will start the Queue Worker with a minimum delay of 0.5 milliseconds between executions, a maximum delay of 1.2 milliseconds, and it will process action IDs 1, 2, and 4.
Default Flags
The Queue Worker has default settings for some parameters:
-processes 1
: By default, it runs in a single process. You can specify a different number of processes if needed.-total_missions inf
: By default, it processes an infinite number of missions. You can limit the total number of missions if necessary. Feel free to adjust these flags according to your requirements when running the script.
That's it! You can now use the Queue Worker to efficiently manage and execute tasks from your queue with customized settings.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for queue_worker_local-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 007318a5e844835a1936dfaeba85e289f4f1b24f38ba6d0f12abdbf0b9c03606 |
|
MD5 | 346f3104e6e80a588408a24fe62de686 |
|
BLAKE2b-256 | 7c138212e67fd2bdccf5d764886b81ecaee5ac5ed1caff103c8cc8bfabe70387 |