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

Introduce dispatch event #362

Merged
merged 1 commit into from
Apr 28, 2017

Conversation

Erol
Copy link
Contributor

@Erol Erol commented Apr 27, 2017

This PR introduces a dispatch event which fires whenever the dispatcher loop gets called. The possible use case I'm looking at is to monitor uptime and responsiveness of Shoryuken processes by having a callback to ping an instrumentation endpoint.

@Erol Erol force-pushed the introduce-dispatch-callback branch from c0bdff3 to 03a1e77 Compare April 27, 2017 06:40
@@ -73,6 +73,8 @@ def dispatch_now
return
end

fire_event(:dispatch, false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Erol false is the default value for reverse, I guess you can omit it.

Can you add an expectation in the manager spec for this fire_event call?

@Erol Erol force-pushed the introduce-dispatch-callback branch from 03a1e77 to 3ef721d Compare April 28, 2017 01:07
@Erol
Copy link
Contributor Author

Erol commented Apr 28, 2017

Made the changes requested @phstc. Could you please take a look again?

@phstc phstc merged commit e331de9 into ruby-shoryuken:master Apr 28, 2017
@phstc
Copy link
Collaborator

phstc commented Apr 28, 2017

@Erol awesome. Added to master 🍻

@Erol Erol deleted the introduce-dispatch-callback branch April 28, 2017 01:19
@Erol
Copy link
Contributor Author

Erol commented Apr 28, 2017

That was fast, thanks!

Would you be releasing a new version soon? Would like to bump the version we're using so we can listen for the new event. 🙂

@phstc
Copy link
Collaborator

phstc commented Apr 28, 2017

Hi @Erol

I don't have an ETA for releasing a new version, I usually wait a little longer for adding more stuff. But if nothing shows up soon, I guess I can ship it, but no ETA yet.

You may use it from GitHub:

gem 'shoryuken', git: 'https://github.com/phstc/shoryuken.git', ref: 'e331d'

Usually only requiring from GitHub is fine, since master is usually stable, but the ref above locks with your change.

WDYT?

@Erol
Copy link
Contributor Author

Erol commented Apr 30, 2017

Yeah that's what I opted to do for now until the next release. Thanks for the ref lock tip!

@phstc
Copy link
Collaborator

phstc commented May 18, 2017

hi @Erol I've just released a new version 3.0.7 including your changes!

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