-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Inconsistent behaviour in InlineExecutor vs DefaultExecutor #517
Comments
Hi @ocisly Thanks for investigating that and the well detailed explanation. For a PR, I would go with option 2. BTW if the body parser wasn't just an example, I would recommend you to use |
Thanks! I've opened a PR for option 2. I don't think |
Just looked into that. client middleware wouldn't work out of the box, because |
After several hours of debugging, I've discovered a subtle yet important difference between the two executor implementations.
Shoryuken::Worker::DefaultExecutor.perform_in
relies on the worker class' implementation ofperform_async
:In contrast,
Shoryuken::Worker::InlineExecutor.perform_in
always calls its own implementation ofperform_async
:Now, assume you have a custom
Shoryuken.worker_executor
(e.g. because you want to useto_json
instead ofJSON.dump
)This is wrong and will call
body.to_json
twice. The same code will work fine if you replaceDefaultExecutor
withInlineExecutor
, which is confusing.Which fix would make more sense?
DefaultExecutor.perform_in
to be self contained (calling its own implementation ofperform_async
instead of going via the worker class) orInlineExecutor.perform_in
to delegate to the worker classThe text was updated successfully, but these errors were encountered: