Skip to content

Commit c97b483

Browse files
authored
docs: add more schedule sources (#517)
1 parent 0e2e729 commit c97b483

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

docs/available-components/schedule-sources.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ order: 4
55
# Available schedule sources
66

77
These objects are used to fetch current schedule for tasks.
8-
Currently we have only one schedule source.
98

10-
## RedisScheduleSource
9+
## Official schedule sources
10+
11+
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.
12+
13+
### RedisScheduleSource
1114

1215
This source is capable of adding new schedules in runtime. It uses Redis as a storage for schedules.
1316
To use this source you need to install `taskiq-redis` package.
@@ -24,7 +27,7 @@ scheduler = TaskiqScheduler(broker, sources=[redis_source])
2427
For more information on how to use dynamic schedule sources read [Dynamic scheduling section](../guide/scheduling-tasks.md#dynamic-scheduling).
2528

2629

27-
## LabelScheduleSource
30+
### LabelScheduleSource
2831

2932
This source parses labels of tasks, and if it finds a `schedule` label, it considers this task as scheduled.
3033

@@ -76,3 +79,43 @@ In order to resolve all labels correctly, don't forget to import
7679
all task modules using CLI interface.
7780

7881
:::
82+
83+
### NATS schedule source
84+
85+
This source is capable of adding new schedules in runtime. It uses NATS as a storage for schedules.
86+
To use this source you need to install `taskiq-nats` package.
87+
88+
```python
89+
from taskiq_nats import NATSKeyValueScheduleSource
90+
from taskiq.scheduler import TaskiqScheduler
91+
92+
93+
broker = ...
94+
95+
scheduler = TaskiqScheduler(
96+
broker=broker,
97+
sources=[NATSKeyValueScheduleSource(broker)],
98+
)
99+
```
100+
101+
This schedule source doesn't use `schedule` label on tasks. To add new schedules, you need to call `add_schedule` method on the source.
102+
103+
## Third-party schedule sources
104+
105+
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.
106+
107+
### PostgreSQL schedule source
108+
109+
Project link: [taskiq-postgres](https://github.com/danfimov/taskiq-postgres)
110+
111+
```bash
112+
pip install taskiq-postgres
113+
```
114+
115+
### YDB schedule source
116+
117+
Project link: [taskiq-ydb](https://github.com/danfimov/taskiq-ydb)
118+
119+
```bash
120+
pip install taskiq-ydb
121+
```

docs/guide/testing-taskiq.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ In such a way you don't need to manually call the `wait_result` in your code.
161161
To set it up, define the broker as the following:
162162

163163
```python
164-
...
165-
broker = InMemoryBroker(await_inplace=True)
166-
...
167-
164+
broker = InMemoryBroker(await_inplace=True)
168165
```
169166

170167
With this setup all `await function.kiq()` calls will behave similarly to `await function()`, but

0 commit comments

Comments
 (0)