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

Added support for consumer kwargs #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hemna
Copy link

@hemna hemna commented Dec 22, 2020

I have an app that uses consumer, but needs to pass in some kwargs
for consumption at consumer function call time. This patch adds
kwargs support to consumer creation as well as passing those kwargs
at consumer callback time.

I have an app that uses consumer, but needs to pass in some kwargs
for consumption at consumer function call time.  This patch adds
kwargs support to consumer creation as well as passing those kwargs
at consumer callback time.
@rossengeorgiev
Copy link
Owner

Hi @hemna, thanks for the PR. Not sure what the exact use case for this would be, but it doesn't make sense to me to be part of the package. Have you tried functools.partial ?

@hemna
Copy link
Author

hemna commented Dec 23, 2020

I am writing a gateway like app, which consumes messages from APRS-IS sends those parsed messages through some plugins and responds in separate threads. I need to pass along a queue object, so I can stuff messages to be sent in the queue, without using global variables. it makes sense to be allowed to pass various other params along with a consumer, to keep code clean without the need to use global vars everywhere.

This is the app I'm helping write:
https://github.com/craigerl/aprsd

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 this pull request may close these issues.

None yet

2 participants