evoid-tasks
Background tasks with lifecycle — Intent Handler system
Quick Start • Intent Handler • Lifecycle • API
Quick Start
uv add evoid-tasks
Method 1: Intent Handler (Recommended)
from evoid_tasks import register_handlers
# Register task scheduler as Intent handlers
register_handlers(max_concurrent=10)
Method 2: Direct API
from evoid_tasks import scheduler
# Fire and forget
scheduler.run(send_email, to="alice@example.com")
# Periodic tasks
@scheduler.task(interval=60)
async def cleanup(ctx):
await delete_old_sessions()
Intent Handler
evoid-tasks registers task scheduling as Intent handlers.
Lifecycle (Godot-inspired)
from evoid_tasks import scheduler, TaskContext
@scheduler.task(interval=10)
async def my_task(ctx: TaskContext):
# on_start — called once
print(f"Task {ctx.task_name} started")
# on_tick — called every interval
print(f"Tick {ctx.tick}, delta={ctx.delta}")
# on_stop — called on cancellation
# on_error — called on exception
Configuration
TOML
[engines]
tasks = "tasks"
[engines.options.tasks]
max_concurrent = 10
API
register_handlers(max_concurrent: int = 10)
Register task scheduler as Intent handlers.
Scheduler Methods
| Method | Signature | Description |
|---|---|---|
run |
run(func, *args, **kwargs) |
Fire-and-forget background task |
task |
@task(interval=N) |
Decorator for periodic tasks |
on |
@on(event) |
Listen for named events |
emit |
emit(event, data) |
Emit event to all handlers |
cancel |
cancel(task_def) |
Cancel a running task |
shutdown |
shutdown() |
Cancel all tasks |
Dependencies
evoid>=0.4.0
Links
License
MIT
Metadata
Release files for evoid-tasks 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evoid_tasks-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for evoid_tasks-0.2.0-py3-none-any.whl |
Release files / evoid_tasks-0.2.0-py3-none-any.whl
| Download URL | evoid_tasks-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e5a6876cb3754a7709ea3e0dcc4daf353e3f30cb8531431a20b4911edbb7c58
|
|
BLAKE2b-256 checksum How to use checksums |
c8d2dd0a186bd27f3411a6e0e03504af143cd153bf4b36ed222403c695989588
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for evoid-tasks 0.2.0
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.