You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Middleware has hooks before task execution and after task execution. The order these hooks run in is dependent on the order they are placed on the broker. Lets take an example to illustrate this
Most middleware systems i've interacted with the post hooks happen in reverse order so you can think of going down the chain and back up. So it would be more like
A.startup -> B.startup
... operate
B.shutdown -> A.shutdown
# Sending
A.pre_send -> B.pre_send
...send
B.post_send -> A.post_send
# Execution
A.pre_execute -> B.pre_execute
... execute
B.on_error -> A.on_error (only if there is an error)
B.post_execute -> A.post_execute
B.post_save -> A.post_save
This is helpful if you want middleware to piggy back on others. For example I am creating my own telemetry middleware and would like to appear first down the chain and last up the chain. This allows me to detect things like retries if the Simple or Smart retry middleware appears after.
Is this something that would be of interest to change or provide a configuration parameter to support?
Activity