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

Option to apply all events before state entry functions #37

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

hannahhoward
Copy link
Contributor

@hannahhoward hannahhoward commented May 3, 2022

Goals

This PR adds a long requested feature to go-statemachine -- to process multiple events at once before we apply the next StateEntryFunc.

Implementation

Adds an optional parameter to process multiple state machine updates before applying a state entry func. This has been an ongoing issue where StateEntryFuncs get called after already being outdated by additional state machine events.

It's added as an optional parameter as this is a potentially far reaching change and it's worth rolling it out gradually.

allows processing of multiple events  before calling a state entry func
@hannahhoward hannahhoward force-pushed the feat/apply-all-events-option branch from 4b76c41 to f86db30 Compare May 12, 2022 01:05
@hannahhoward hannahhoward marked this pull request as ready for review May 12, 2022 01:07
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

My only critique here is that the tests don't really seem to be testing anything specific about consumeAllEventsBeforeEntryFuncs except for the incompleteness in TestConsumeAllEvents. But the tests do make sure events are processed, just nothing particularly special about the way they are processed.

@hannahhoward hannahhoward merged commit 029d947 into master Oct 8, 2022
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