Skip to content

Commit 8ecbb23

Browse files
committed
update return type of EntityBehavior init method
1 parent 826f7be commit 8ecbb23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/scala/app/softnetwork/persistence/typed/EntityBehavior.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package app.softnetwork.persistence.typed
33
import akka.actor.typed.scaladsl.{ActorContext, Behaviors, TimerScheduler}
44
import akka.actor.typed.{ActorRef, ActorSystem, Behavior, SupervisorStrategy}
55

6+
import akka.cluster.sharding.typed.ShardingEnvelope
67
import akka.cluster.sharding.typed.scaladsl.{ClusterSharding, Entity, EntityTypeKey}
78

89
import akka.persistence.typed._
@@ -113,11 +114,11 @@ trait EntityBehavior[C <: Command, S <: State, E <: Event, R <: CommandResult]
113114
* - an optional node role required to start this entity
114115
* @param c
115116
* - runtime class of C
116-
* @return
117+
* @return a reference to the corresponding sharding envelope
117118
*/
118119
def init(system: ActorSystem[_], maybeRole: Option[String] = None)(implicit
119120
c: ClassTag[C]
120-
): Unit = {
121+
): ActorRef[ShardingEnvelope[C]] = {
121122
ClusterSharding(system) init Entity(TypeKey) { entityContext =>
122123
this(
123124
entityContext.entityId,

0 commit comments

Comments
 (0)