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

Video intro on frontpage cannot be followed using [redis] #483

Closed
7 tasks done
kurtmckee opened this issue Mar 17, 2022 · 2 comments · Fixed by #486
Closed
7 tasks done

Video intro on frontpage cannot be followed using [redis] #483

kurtmckee opened this issue Mar 17, 2022 · 2 comments · Fixed by #486

Comments

@kurtmckee
Copy link
Contributor

kurtmckee commented Mar 17, 2022

Issues

GitHub issues are for bugs. If you have questions, please ask them on the discussion board.

Checklist

  • Does your title concisely summarize the problem?
  • Did you include a minimal, reproducible example?
  • What OS are you using?
  • What version of Dramatiq are you using?
  • What did you do?
  • What did you expect would happen?
  • What happened?

What OS are you using?

Ubuntu 21.04

What version of Dramatiq are you using?

1.12.3

What did you do?

I installed dramatiq using the [redis] extras:

pip install dramatiq[redis,watch]

I then used the same count_to() code as presented at the beginning of the video.

What did you expect would happen?

I expected that dramatiq would connect to redis based on these assumptions:

  • I installed the [redis] extras, not [rabbitmq]
  • No configuration is shown to be required in the video

What happened?

Python displayed a traceback showing that the pika library could not be imported.

This is happening because dramatiq.broker.get_broker() assumes that if no broker has been configured, RabbitMQ should be used. However, it does not guard against import errors.

This type of situation is also not caught by the unit tests because tox does not have different environments configured for different extras dependencies.

I installed pika, which prevented the traceback, but I got frequent screen output showing that there were connection failures every few seconds.

Suggested solution

I'd like to submit a PR that introduces redis as a fallback if pika is not installed. If that seems reasonable I'll work to get that done and submitted for review.

This is entirely for making it possible to follow the tutorial using redis instead of RabbitMQ! I learned how to configure the broker to prevent the automatic fallback to RabbitMQ, so I'm not blocked. I just want to improve others' first experience with the library.

Thanks for all of your work on dramatiq!

@Bogdanp
Copy link
Owner

Bogdanp commented Mar 18, 2022

Your suggestion sounds good to me, so feel free to go ahead and make a PR!

@kurtmckee
Copy link
Contributor Author

Okay, great! I'll give it a shot! 😀 👍

kurtmckee added a commit to kurtmckee/pr-dramatiq that referenced this issue Mar 18, 2022
This change allows users to use Redis when working through the intro video.

Closes Bogdanp#483
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

Successfully merging a pull request may close this issue.

2 participants