Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskiqDeprecationWarning: use with_result_backend #71

Open
tito opened this issue Oct 9, 2024 · 5 comments
Open

TaskiqDeprecationWarning: use with_result_backend #71

tito opened this issue Oct 9, 2024 · 5 comments

Comments

@tito
Copy link

tito commented Oct 9, 2024

Using taskiq 0.11.7 and taskiq-redis 1.0.2, i have this deprecation warning showing up:

/.venv/lib/python3.10/site-packages/taskiq_redis/redis_broker.py:49: TaskiqDeprecationWarning: Setting result backend with constructor is deprecated. Please use `with_result_backend` instead.

The code that triggered it:

from taskiq_redis import ListQueueBroker, RedisAsyncResultBackend

from app.core.config import settings

redis_async_result = RedisAsyncResultBackend(redis_url=settings.REDIS_URL)

broker = ListQueueBroker(
    url=settings.REDIS_URL,
    result_backend=redis_async_result,
)
@ItsCurstin
Copy link

ItsCurstin commented Oct 9, 2024

I guess the github docs for this repo hasn't been updated yet. There is a with_result_backend method on ListQueueBroker as well.

from this doc: https://taskiq-python.github.io/guide/getting-started.html#distributed-run

from taskiq_aio_pika import AioPikaBroker
from taskiq_redis import RedisAsyncResultBackend

broker = AioPikaBroker(
    "amqp://guest:guest@localhost:5672",
).with_result_backend(RedisAsyncResultBackend("redis://localhost"))

@tito

@s3rius
Copy link
Member

s3rius commented Oct 10, 2024

@CurstinJR, yes, you are correct. Will update soon.

@tito
Copy link
Author

tito commented Oct 10, 2024

Works, thank you !

@remixer-dec
Copy link

@s3rius hello, can you please clarify if it is necessary to call broker.startup() with ListQueueBroker in taskiq_redis?

@s3rius
Copy link
Member

s3rius commented Oct 11, 2024

It's kinda not, but I highly advise you doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants