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

statemachine: Make commands more robust with 2 phases: Receive + Acknowledge #137

Open
schmichael opened this issue Aug 3, 2015 · 2 comments

Comments

@schmichael
Copy link
Contributor

Overview

Currently Metafora statemachine commands are like UNIX signals, they can be ignored by user code entirely.

It would be preferable for commands to persist until user code at least acknowledges their receipt.

Details

The current statemachine.Command interface only has a Receive() method. Once a Command is received, it is forgotten. If user code exits before receiving the command or an unexpected shutdown occurs, the command will have never been seen by user code.

Implementation

  • Make Receive() *statemachine.Message become Receive() statemachine.Command
  • Create interface:
type Command interface {
    Message() Message
    Ack()
}

Where until Ack() is called, subsequent calls to Receive() should return the same Command

@mdmarek
Copy link
Contributor

mdmarek commented Aug 3, 2015

Are the commands saved in etcd? So the idea is that the command is there until the code calls Ack, Ack then becomes the way a command is actually deleted?

@schmichael
Copy link
Contributor Author

@mdmarek Yeah, that's what I'm thinking.

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

No branches or pull requests

2 participants