mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #104] [FEATURE REQUEST] Handler function middleware #28
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rugwirobaker on GitHub (Mar 6, 2020).
Original GitHub issue: https://github.com/hibiken/asynq/issues/104
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
Do plan to support middleware functions that behave the same way for example gorilla mux.Middware do? If not how do logging??
@hibiken commented on GitHub (Mar 6, 2020):
@rugwirobaker Thanks for this feature request!
Could you provide an example code for a potential API for middleware support?
Alternatively, can you simply write a middleware function and wrap your handlers with that middleware?
would that work? Or should the package offer better support for middleware chain?
@rugwirobaker commented on GitHub (Mar 7, 2020):
For most use cases this works fine but in cases where you have a lot of middleware functions having something like:
mux.Use(someMiddlware)ormux.Add(someMiddleware)it would help avoid the clutter.@hibiken commented on GitHub (Mar 7, 2020):
Ok that makes sense.
Let's add
Usemethod to add middlewares to the chain, similar to gorilla/mux#Route.Use. The method should be a variadic function that takes any number of middleware functions. They should be executed in the order that they are applied.Example: