-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
FeatReq: Typehints in dramatiq.middleware #521
Comments
Perhaps this discussion should be expanded to all of the Dramatic package: the current implementation doesn’t seem to use type hints (although I saw the odd use of it). Perhaps, though, @Bogdanp plans to add them with v2 at some point? |
Definitely would be nice to do all of it. I asked specifically about the middleware as there's no documentation on what the arguments to the middleware functions actually are (just their names) and I need to write some to deal with Postgres schema changing while running jobs. So I had to do some custom logging to figure out what the arguments were to be able to make a middleware. |
A little bit of an update with the latest version just out: We have a number of custom middlewares, and in some of them we will set |
Just a small request (doesn't everyone say that?). I love the ability to use my own middleware to customize the messages and add some custom logging. One thing I noticed is there's no type type hinting in the dramatiq.middleware.Middleware class. As a new developer to the package, for places where I am meant to extend the code, it's really helpful to have some hints as to the types to expect. Also might be good to note in the docs that you can alter the arguments, such as the message, and that will be propigated.
Simplified example of what I mean:
It's a small thing sure, but it does make it easier to write middleware.
The text was updated successfully, but these errors were encountered: