Some usages of the removed signatures

This commit is contained in:
Johan Andrén 2018-09-21 10:34:41 +02:00
parent f8d182574a
commit 10fc413238
5 changed files with 4 additions and 18 deletions

View file

@ -47,7 +47,7 @@ object ClusterShardingPersistenceSpec {
PersistentBehaviors.receive[Command, String, String]( PersistentBehaviors.receive[Command, String, String](
entityId, entityId,
emptyState = "", emptyState = "",
commandHandler = (_, state, cmd) cmd match { commandHandler = (state, cmd) cmd match {
case Add(s) Effect.persist(s) case Add(s) Effect.persist(s)
case Get(replyTo) case Get(replyTo)
replyTo ! s"$entityId:$state" replyTo ! s"$entityId:$state"

View file

@ -39,7 +39,7 @@ object ClusterSingletonPersistenceSpec {
PersistentBehaviors.receive[Command, String, String]( PersistentBehaviors.receive[Command, String, String](
persistenceId = "TheSingleton", persistenceId = "TheSingleton",
emptyState = "", emptyState = "",
commandHandler = (_, state, cmd) cmd match { commandHandler = (state, cmd) cmd match {
case Add(s) Effect.persist(s) case Add(s) Effect.persist(s)
case Get(replyTo) case Get(replyTo)
replyTo ! state replyTo ! state

View file

@ -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] { trait PersistentBehavior[Command, Event, State] extends DeferredBehavior[Command] {

View file

@ -506,5 +506,4 @@ public class PersistentActorJavaDslTest extends JUnitSuite {
} }
//event-wrapper //event-wrapper
// FIXME test with by state command handler
} }

View file

@ -94,10 +94,8 @@ object InDepthPersistentBehaviorSpec {
//#by-state-command-handler //#by-state-command-handler
private val commandHandler: (BlogState, BlogCommand) Effect[BlogEvent, BlogState] = { (state, command) private val commandHandler: (BlogState, BlogCommand) Effect[BlogEvent, BlogState] = { (state, command)
state match { if (state.isEmpty) initial(state, command)
case state if state.isEmpty initial(state, command) else postAdded(state, command)
case state if !state.isEmpty postAdded(state, command)
}
} }
//#by-state-command-handler //#by-state-command-handler