-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Samples for replicated event sourcing over gRPC (#769)
Additionally: * Api to allow replicated behaviors to compose with setup behaviors
- Loading branch information
Showing
69 changed files
with
2,620 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...on-grpc/src/main/scala/akka/projection/grpc/replication/javadsl/ReplicatedBehaviors.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.projection.grpc.replication.javadsl | ||
|
||
import akka.actor.typed.Behavior | ||
import akka.annotation.ApiMayChange | ||
import akka.japi.function.{ Function => JFunction } | ||
import akka.persistence.typed.javadsl.EventSourcedBehavior | ||
import akka.persistence.typed.javadsl.ReplicationContext | ||
|
||
/** | ||
* Dynamically provides factory methods for creating replicated event sourced behaviors. | ||
* | ||
* Must be used to create an event sourced behavior to be replicated with [[Replication.grpcReplication]]. | ||
* | ||
* Can optionally be composed with other Behavior factories, to get access to actor context or timers. | ||
*/ | ||
@ApiMayChange | ||
abstract class ReplicatedBehaviors[Command, Event, State] { | ||
def setup(factory: JFunction[ReplicationContext, EventSourcedBehavior[Command, Event, State]]): Behavior[Command] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...n-grpc/src/main/scala/akka/projection/grpc/replication/scaladsl/ReplicatedBehaviors.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.projection.grpc.replication.scaladsl | ||
|
||
import akka.actor.typed.Behavior | ||
import akka.annotation.ApiMayChange | ||
import akka.persistence.typed.scaladsl.EventSourcedBehavior | ||
import akka.persistence.typed.scaladsl.ReplicationContext | ||
|
||
/** | ||
* Dynamically provides factory methods for creating replicated event sourced behaviors. | ||
* | ||
* Must be used to create an event sourced behavior to be replicated with [[Replication.grpcReplication]]. | ||
* | ||
* Can optionally be composed with other Behavior factories, to get access to actor context or timers. | ||
*/ | ||
@ApiMayChange | ||
abstract class ReplicatedBehaviors[Command, Event, State] { | ||
def setup(factory: ReplicationContext => EventSourcedBehavior[Command, Event, State]): Behavior[Command] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.