Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Automated event handler invocation after successful event persistence #93

Closed
krasserm opened this issue Aug 1, 2015 · 1 comment · Fixed by #164
Closed

Automated event handler invocation after successful event persistence #93

krasserm opened this issue Aug 1, 2015 · 1 comment · Fixed by #164
Assignees
Milestone

Comments

@krasserm
Copy link
Contributor

krasserm commented Aug 1, 2015

At the moment, a persist handler must explicitly call onEvent for successfully persisted events:

persist(evt) {
  case Success(_) =>
    onEvent(evt)
    // ...
  case Failure(e) =>
    // ...
}

This should be automated so that application code doesn't need to call onEvent anymore:

persist(evt) {
  case Success(_) =>
    // ...
  case Failure(e) =>
    // ...
}
@krasserm krasserm modified the milestone: 0.4 Sep 14, 2015
@krasserm krasserm added ready and removed evaluation labels Sep 14, 2015
@krasserm krasserm added core and removed core labels Nov 14, 2015
@krasserm krasserm self-assigned this Nov 22, 2015
@krasserm krasserm added the rgp label Dec 5, 2015
@krasserm
Copy link
Contributor Author

krasserm commented Dec 7, 2015

Also covered by this ticket is a new recommendation how to define command, event and snapshot handlers:

  • Instead of override val onCommand: Receive = { ... } a command handler should now be defined as override def onCommand = { ... }
  • Instead of override val onEvent: Receive = { ... } an event handler should now be defined as override def onCommand = { ... }
  • Instead of override val onSnapshot: Receive = { ... } a snapshot handler should now be defined as override def onSnapshot = { ... }

krasserm added a commit that referenced this issue Dec 7, 2015
- applications don't need to call onEvent in a persist handler anymore
- closes #93

Further changes:

- command handler can now be defined as override def onCommand = ...
- event handler can now be defined as override def onEvent = ...
- snapshot handler can now be defined as override def onSnapshot = ...
@krasserm krasserm added in progress and removed ready labels Dec 7, 2015
krasserm added a commit that referenced this issue Dec 7, 2015
- applications don't need to call onEvent in a persist handler anymore
- closes #93

Further changes:

- command handler can now be defined as override def onCommand = ...
- event handler can now be defined as override def onEvent = ...
- snapshot handler can now be defined as override def onSnapshot = ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant