Skip to main content

a scheduler for graia framework

Project description

Graia Scheduler

一个基于 asyncio, 设计简洁, 代码简单的计划任务库, 使用 loop.create_task 创建计划任务;
同时使用生成器特性与 croniter 的定时设计, 轻盈而强大.

Install

pip install graia-scheduler

# or use poetry
poetry add graia-scheduler

使用

import asyncio
from graia.broadcast import Broadcast
from graia.scheduler import GraiaScheduler
from graia.scheduler.timers import crontabify

loop = asyncio.new_event_loop()

bcc = Broadcast(loop=loop)
scheduler = GraiaScheduler(loop, bcc)

@scheduler.schedule(crontabify("* * * * * *"))
def something_scheduled():
    print("print every second.")

loop.run_forever()

因为基于 BroadcastControl, 你可以享受使用 Dispatcher, Interrupt, Decorator 的开发体验.

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

graia-scheduler-0.1.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

graia_scheduler-0.1.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file graia-scheduler-0.1.2.tar.gz.

File metadata

  • Download URL: graia-scheduler-0.1.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for graia-scheduler-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c22ae4a101e0965cd36b00a44c449fa0fc48b1da9a982d2192bd11caeb462ad
MD5 15eadf23cf39c3c4c4bd75b6ed8380fa
BLAKE2b-256 f871a9061ce75608cbd384205d8fa9242980e0cdf17faa9233d7c358ea11118b

See more details on using hashes here.

File details

Details for the file graia_scheduler-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for graia_scheduler-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9f88b15e74c0cbda1d0947533d7a3b0bb597d3419df8b2d602d25d53451a6665
MD5 a3f04aab482b004120f8e8ac686399b4
BLAKE2b-256 1a5473c4b1e0cc6aaf9943adbb6e6a6e0ca44f7b597f7bc5a542e8e2be0babae

See more details on using hashes here.

Supported by

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