Do you suggest something like this?
def immutable[Command, Event, State](
persistenceId: String,
initialState: State,
actions: State => Actions[Command, Event, State],
applyEvent: (Event, State) ⇒ State): PersistentBehavior[Command,
Event, State]
I it would be rather difficult to understand what state that is, especially
since there is also Actions.byState. A typical usage of onRecoveryCompleted
is to perform side effects, such as resending to an external service, and
it's better to not mixing that concern with the construction of the command
handlers.
/Patrik
On Wed, Oct 18, 2017 at 2:54 PM, Yaroslav Klymko <[email protected]> wrote:
> Hi guys,
> Not sure this is the right place to ask:
> I'm looking into akka typed for persistence and wondering whether we
> really need onRecoveryCompleted at https://github.com/akka/akka/
> blob/master/akka-typed/src/main/scala/akka/typed/persistence/scaladsl/
> PersistentActor.scala#L174
> Why not just have something like actions: State =>
> PersistentActor.Actions[Command,
> Event, State] ?
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> - Reactive apps on the JVM
Twitter: @patriknw
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.