Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions docs/available-components/schedule-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

Expand Down Expand Up @@ -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
```
5 changes: 1 addition & 4 deletions docs/guide/testing-taskiq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down