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

feature: add middleware after_{consumer,worker}_thread_boot hooks #619

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

kamalmarhubi
Copy link
Contributor

This allows the middleware to run code in the context of a worker or consumer thread before it enters its run loop. This could be used to set up thread-local resources, or as in the author's case, to get a reference to the thread before it does any work.

This was proposed on the mailing list 0 with Bogdan accepting the idea in principle 1.

This allows the middleware to run code in the context of a worker or
consumer thread before it enters its run loop. This could be used to set
up thread-local resources, or as in the author's case, to get a reference
to the thread before it does any work.

This was proposed on the mailing list [0] with Bogdan accepting the idea
in principle [1].

[0]: https://groups.io/g/dramatiq-users/topic/105311701
[1]: https://groups.io/g/dramatiq-users/topic/105311701#258
@kamalmarhubi kamalmarhubi marked this pull request as draft April 11, 2024 19:57
@kamalmarhubi
Copy link
Contributor Author

kamalmarhubi commented Apr 11, 2024

converted to draft; will mark it ready for review after we've run our code using the hooks for a few days to be sure these hooks are adequate

@kamalmarhubi kamalmarhubi marked this pull request as ready for review April 22, 2024 20:54
@kamalmarhubi
Copy link
Contributor Author

@Bogdanp we've been runing a cherry-pick of this onto the version we use in prod and it's allowed us to start workers in a paused state as described in the mailing list.

@Bogdanp Bogdanp merged commit 1fab55f into Bogdanp:master Apr 23, 2024
11 checks passed
@Bogdanp
Copy link
Owner

Bogdanp commented Apr 23, 2024

Thanks!

@kamalmarhubi
Copy link
Contributor Author

@Bogdanp quick question: do you expect to make a release containing this any time soon? like I said we're running with a cherry-pick which is fine, mostly just want to have a mental note to do the upgrade if / when it's released. thanks!

@Bogdanp
Copy link
Owner

Bogdanp commented May 2, 2024

@kamalmarhubi I plan to make a release sometime next week.

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.

2 participants