This repository has been archived by the owner on Jun 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support usage of last* methods in pattern guards
- closes #205
- Loading branch information
Showing
2 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,12 +206,17 @@ trait EventsourcedView extends Actor with Stash with ActorLogging { | |
*/ | ||
private[eventuate] def receiveEvent(event: DurableEvent): Unit = { | ||
val behavior = _eventContext.current | ||
if (behavior.isDefinedAt(event.payload)) try { | ||
_eventHandling = true | ||
receiveEventInternal(event) | ||
behavior(event.payload) | ||
if (!recovering) conditionChanged(currentVectorTime) | ||
} finally _eventHandling = false | ||
val previous = lastHandledEvent | ||
|
||
_lastHandledEvent = event | ||
if (behavior.isDefinedAt(event.payload)) { | ||
try { | ||
_eventHandling = true | ||
receiveEventInternal(event) | ||
behavior(event.payload) | ||
if (!recovering) conditionChanged(currentVectorTime) | ||
} finally _eventHandling = false | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
krasserm
Author
Contributor
|
||
} else _lastHandledEvent = previous | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 69f3221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Not related to this change, but why does this actually has to be done in a
finally
branch? In case of an exception we will anyways get a new actor-instance, right?