Create asynchronous and asynchronous task
Project description
QMate
Create asynchronous and asynchronous task queues that run on a schedule... symantically.
Examples
Full Example
Run the function PrintSomething every quarter of every minute:
from qmate import Queue, Task
import time
def PrintSomething(text):
print(text)
queue = Queue(True)
queue.schedule(
Task(
func=PrintSomething,
name='Print Something',
at=["00", "15", "30", "45"],
args=["Working"]
)
)
while True:
time.sleep(0.001)
Queue.schedule takes a single task or a list of tasks.
queue.schedule(
[
Task(
func=PrintSomething,
name='Quarterly Print',
at=["00", "15", "30", "45"],
args=["Working"]
),
Task(
func=PrintSomething,
name='10PM Print',
at=["22:00:00"],
args=["It's 10PM."]
)
]
)
Task Time Parameters
Every cannot be combined with other time parameters. At, On, and During can be combined. At is required, unless using Every.
On
Run tasks on specific days. If empty, run everyday.
on=["Sunday", "Monday"] # on Sundays and Mondays
on=["everyday"] # on everyday of the week
At
Run tasks at certain times.
at=["17:30:00"] # at 5:30 PM
at=["30:00"] # at 30 minutes past every hour
at=["15", "45"] # at a quarter past and a quarter till every hour
During
Run tasks during specfic months. If empty, run every month.
during=["May", "July"] # during the months of may and july
Every
Run tasks on certain intervals. Max time: 23:59:59
every=["3:30:00"] # every 3 hours, 30 minutes
every=["03:00"] # every 3 minutes
every=["30"] # every 30 seconds
Examples
Create a task to PrintSomething everyday of the week at 10AM and 10PM, during the month of September:
Task(
func=PrintSomething,
name='Print Something',
on=["Everyday"],
at=["10:00:00", "22:00:00"],
during=["September"],
args=["Working"]
)
Create a task to PrintSomething on Saturday and Sunday ten minutes past every hour:
Task(
func=PrintSomething,
name='Print Something',
on=["Saturday", "Sunday"],
at=["10:00"],
during=["September"],
args=["Working"]
)
Create a task to run every 10 seconds and pass it multiple arguments:
Acceptable formats: 23:59:59, 59:59, 59
Task(
func=MultipleArgument,
name='Run every 10 seconds',
every=["10"],
args=["Houston", 713]
)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qmate-0.0.2.tar.gz.
File metadata
- Download URL: qmate-0.0.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddd127f546ccdb6c19be275898c41cad646e21bf3d272bf26ecc8be04758c211
|
|
| MD5 |
182efefa009b90c229ef74d0e563e2ba
|
|
| BLAKE2b-256 |
265d34507ebf188666ce0e77a930d89084fbf6f3f2520c1e6c9ac511c9d19a22
|
Provenance
The following attestation bundles were made for qmate-0.0.2.tar.gz:
Publisher:
publish.yml on digitalkelvin/qmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qmate-0.0.2.tar.gz -
Subject digest:
ddd127f546ccdb6c19be275898c41cad646e21bf3d272bf26ecc8be04758c211 - Sigstore transparency entry: 174781156
- Sigstore integration time:
-
Permalink:
digitalkelvin/qmate@3433bdba29fc0bad11f7d7da142068933819293a -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/digitalkelvin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3433bdba29fc0bad11f7d7da142068933819293a -
Trigger Event:
push
-
Statement type:
File details
Details for the file qmate-0.0.2-py3-none-any.whl.
File metadata
- Download URL: qmate-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15bc6ac4bebc7f1f84d70339d03e334e2a638d6c750ced47e5a1c0e17ce15bda
|
|
| MD5 |
a138f869c54cc2e5b9cd263d473bdd62
|
|
| BLAKE2b-256 |
52fb506a26e141f7b5bcf5a01b8022ba895f6c14f58a3ca333779b3948f778ec
|
Provenance
The following attestation bundles were made for qmate-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on digitalkelvin/qmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qmate-0.0.2-py3-none-any.whl -
Subject digest:
15bc6ac4bebc7f1f84d70339d03e334e2a638d6c750ced47e5a1c0e17ce15bda - Sigstore transparency entry: 174781160
- Sigstore integration time:
-
Permalink:
digitalkelvin/qmate@3433bdba29fc0bad11f7d7da142068933819293a -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/digitalkelvin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3433bdba29fc0bad11f7d7da142068933819293a -
Trigger Event:
push
-
Statement type: