Add paramater documentation for event sourced entities (#28540)

* Add paramater documentation for event sourced entities

Useful for help in IDEs, text taken from the docs.

* whitespace

Co-authored-by: Arnout Engelen <github@bzzt.net>
This commit is contained in:
Christopher Batey 2020-01-31 15:09:02 +00:00 committed by GitHub
parent a6cc73b447
commit 0d57c71766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -23,10 +23,17 @@ abstract class EventSourcedBehavior[Command, Event, State] private[akka] (
onPersistFailure: Optional[BackoffSupervisorStrategy])
extends DeferredBehavior[Command] {
/**
* @param persistenceId stable unique identifier for the event sourced behavior
*/
def this(persistenceId: PersistenceId) = {
this(persistenceId, Optional.empty[BackoffSupervisorStrategy])
}
/**
* @param persistenceId stable unique identifier for the event sourced behavior
* @param onPersistFailure BackoffSupervisionStrategy for persist failures
*/
def this(persistenceId: PersistenceId, onPersistFailure: BackoffSupervisorStrategy) = {
this(persistenceId, Optional.ofNullable(onPersistFailure))
}

View file

@ -43,6 +43,11 @@ object EventSourcedBehavior {
/**
* Create a `Behavior` for a persistent actor.
*
* @param persistenceId stable unique identifier for the event sourced behavior
* @param emtpyState the intial state for the entity before any events have been processed
* @param commandHandler map commands to effects e.g. persisting events, replying to commands
* @param evnetHandler compute the new state given the current state when an event has been persisted
*/
def apply[Command, Event, State](
persistenceId: PersistenceId,