Some usages of the removed signatures
This commit is contained in:
parent
f8d182574a
commit
10fc413238
5 changed files with 4 additions and 18 deletions
|
|
@ -47,7 +47,7 @@ object ClusterShardingPersistenceSpec {
|
|||
PersistentBehaviors.receive[Command, String, String](
|
||||
entityId,
|
||||
emptyState = "",
|
||||
commandHandler = (_, state, cmd) ⇒ cmd match {
|
||||
commandHandler = (state, cmd) ⇒ cmd match {
|
||||
case Add(s) ⇒ Effect.persist(s)
|
||||
case Get(replyTo) ⇒
|
||||
replyTo ! s"$entityId:$state"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ object ClusterSingletonPersistenceSpec {
|
|||
PersistentBehaviors.receive[Command, String, String](
|
||||
persistenceId = "TheSingleton",
|
||||
emptyState = "",
|
||||
commandHandler = (_, state, cmd) ⇒ cmd match {
|
||||
commandHandler = (state, cmd) ⇒ cmd match {
|
||||
case Add(s) ⇒ Effect.persist(s)
|
||||
case Get(replyTo) ⇒
|
||||
replyTo ! state
|
||||
|
|
|
|||
|
|
@ -67,17 +67,6 @@ object PersistentBehaviors {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
@InternalApi private[akka] final class ByStateCommandHandler[Command, Event, State](
|
||||
choice: State ⇒ CommandHandler[Command, Event, State])
|
||||
extends CommandHandler[Command, Event, State] {
|
||||
|
||||
override def apply(state: State, cmd: Command): Effect[Event, State] =
|
||||
choice(state)(state, cmd)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
trait PersistentBehavior[Command, Event, State] extends DeferredBehavior[Command] {
|
||||
|
|
|
|||
|
|
@ -506,5 +506,4 @@ public class PersistentActorJavaDslTest extends JUnitSuite {
|
|||
}
|
||||
//event-wrapper
|
||||
|
||||
// FIXME test with by state command handler
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,10 +94,8 @@ object InDepthPersistentBehaviorSpec {
|
|||
|
||||
//#by-state-command-handler
|
||||
private val commandHandler: (BlogState, BlogCommand) ⇒ Effect[BlogEvent, BlogState] = { (state, command) ⇒
|
||||
state match {
|
||||
case state if state.isEmpty ⇒ initial(state, command)
|
||||
case state if !state.isEmpty ⇒ postAdded(state, command)
|
||||
}
|
||||
if (state.isEmpty) initial(state, command)
|
||||
else postAdded(state, command)
|
||||
}
|
||||
//#by-state-command-handler
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue