Skip to main content

asyncio job scheduler

Project description

aiosched - asyncio jobs scheduler

Executes specified asyncio jobs with a chosen interval. Has relatively small number of features but it's fast.

Why one more scheduler?

  • it's extremely accurate and fast
  • it's simple
  • all methods are thread-safe

Example

from aiosched import scheduler
import asyncio

async def test1(a, b, c):
    print(f'JOB1 {a} {b} {c}')

async def test2():
    print('JOB2')

async def test3():
    print('JOB3')

from aiosched import scheduler

loop = asyncio.new_event_loop()
scheduler.start(loop=loop)
# tsks can be added before actual start in pending mode
job1 = scheduler.create_threadsafe(target=test1, args=(1,2,3), interval=0.1)
job2 = scheduler.create_threadsafe(target=test2, interval=2)
job3 = scheduler.create_threadsafe(target=test3, interval=0.5)
# cancel job 2
scheduler.cancel(job2)
loop.run_forever()

Install

pip3 install aiosched

Advanced

Read AsyncJobScheduler and AsyncScheduledJob classes documentation in pydoc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiosched-0.0.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file aiosched-0.0.1.tar.gz.

File metadata

  • Download URL: aiosched-0.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for aiosched-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5e0fa96a7c7bb09e5d8cfd8f81bf21a993bbbba5aa892d9bd15aaca90d4cf0f8
MD5 bb2df510756d50373d706e4afeae4821
BLAKE2b-256 13828919b38926f52ea1fe7d357fdf957d1faba944babfd4c2d9bb182d7c4218

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page