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

Queue the events in the event bus before the bus is started. #117

Closed
wants to merge 1 commit into from

Conversation

brasmusson
Copy link
Contributor

@brasmusson brasmusson commented Nov 27, 2016

Summary

To avoid that listeners miss events broadcast before the got a change to register themselves with the event bus, the bus needs to queue events until an explicit start message is received.

Details

Before the EventBus#start method has been called, the EventBus will queue broadcast events, and then pass them on to the handlers when EventBus#start is called.
After the EventBus#start method has been called, the EventBus immediately pass on broadcast event to the handlers.

Motivation and Context

Is needed for fix of cucumber/cucumber-ruby#1041, see cucumber/cucumber-ruby#1059.

How Has This Been Tested?

Rspec specs have been updated to cover the changed functionality.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code

To avoid that listeners miss events broadcast before the got a change
to register themselves with the event bus, the bus needs to queue
events until an exeplicit start message is received.
@mattwynne
Copy link
Member

@brasmusson I finally had a chance to get my head around this change. I had a think about it, and I wonder if it might be simpler, rather than having an explicit start method, to just queue all events, and automatically replay any queued events to new subscribers as they register. WDYT?

I had a play with that idea here: https://github.com/cucumber/cucumber-ruby-core/compare/event-bus-queue-alternative

Would it work?

@brasmusson
Copy link
Contributor Author

@mattwynne Yes the event-bus-queue-alternative should work - with it I have managed to verify that cucumber/cucumber-ruby#1041 would disappear with it. What I still would change in Cucumber-Ruby from cucumber/cucumber-ruby#1059 is most of the changes in runtime.rb - reverting the changes from cucumber/cucumber-ruby#977 in runtime.rb to be exact - delaying the loading of step definitions until the formatters are created which was introduced there - does not make any sense any more.

@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants