Skip to content

Documentation examples uses deprecated classes #1

@literally-user

Description

@literally-user

Problem

Example code in the scheduling-tasks section uses RedisScheduleSource class which is deprecated. I propose to rewrite the documentation using new classes.
Scheduling tasks

Code

from taskiq_redis import ListQueueBroker, RedisScheduleSource

from taskiq import TaskiqScheduler

# Here's the broker that is going to execute tasks
broker = ListQueueBroker("redis://localhost:6379/0")

# Here's the source that is used to store scheduled tasks
redis_source = RedisScheduleSource("redis://localhost:6379/0")

# And here's the scheduler that is used to query scheduled sources
scheduler = TaskiqScheduler(broker, sources=[redis_source])


@broker.task
async def my_task(arg1: int, arg2: str) -> None:
    """Example task."""
    print("Hello from my_task!", arg1, arg2)  # noqa: T201

Result

/home/ltu/PycharmProjects/tazikq/main.py:9: DeprecationWarning: RedisScheduleSource is deprecated. Please switch to ListRedisScheduleSource
  redis_source = RedisScheduleSource("redis://localhost:6379/0")

I think I can drop my PR here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions