diff --git a/docs/available-components/schedule-sources.md b/docs/available-components/schedule-sources.md index 4502ac0..73e75e2 100644 --- a/docs/available-components/schedule-sources.md +++ b/docs/available-components/schedule-sources.md @@ -5,9 +5,12 @@ order: 4 # Available schedule sources These objects are used to fetch current schedule for tasks. -Currently we have only one schedule source. -## RedisScheduleSource +## Official schedule sources + +These schedule sources are not part of the core Taskiq library. But they are maintained by Taskiq developers. You can install them as a separate package. + +### RedisScheduleSource This source is capable of adding new schedules in runtime. It uses Redis as a storage for schedules. To use this source you need to install `taskiq-redis` package. @@ -24,7 +27,7 @@ scheduler = TaskiqScheduler(broker, sources=[redis_source]) For more information on how to use dynamic schedule sources read [Dynamic scheduling section](../guide/scheduling-tasks.md#dynamic-scheduling). -## LabelScheduleSource +### LabelScheduleSource This source parses labels of tasks, and if it finds a `schedule` label, it considers this task as scheduled. @@ -76,3 +79,43 @@ In order to resolve all labels correctly, don't forget to import all task modules using CLI interface. ::: + +### NATS schedule source + +This source is capable of adding new schedules in runtime. It uses NATS as a storage for schedules. +To use this source you need to install `taskiq-nats` package. + +```python +from taskiq_nats import NATSKeyValueScheduleSource +from taskiq.scheduler import TaskiqScheduler + + +broker = ... + +scheduler = TaskiqScheduler( + broker=broker, + sources=[NATSKeyValueScheduleSource(broker)], +) +``` + +This schedule source doesn't use `schedule` label on tasks. To add new schedules, you need to call `add_schedule` method on the source. + +## Third-party schedule sources + +These schedule sources are not part of the core Taskiq library. They are maintained by other open‑source contributors. You can install them as a separate packages. + +### PostgreSQL schedule source + +Project link: [taskiq-postgres](https://github.com/danfimov/taskiq-postgres) + +```bash +pip install taskiq-postgres +``` + +### YDB schedule source + +Project link: [taskiq-ydb](https://github.com/danfimov/taskiq-ydb) + +```bash +pip install taskiq-ydb +``` diff --git a/docs/guide/testing-taskiq.md b/docs/guide/testing-taskiq.md index 58857e0..b132c92 100644 --- a/docs/guide/testing-taskiq.md +++ b/docs/guide/testing-taskiq.md @@ -161,10 +161,7 @@ In such a way you don't need to manually call the `wait_result` in your code. To set it up, define the broker as the following: ```python -... - broker = InMemoryBroker(await_inplace=True) -... - +broker = InMemoryBroker(await_inplace=True) ``` With this setup all `await function.kiq()` calls will behave similarly to `await function()`, but