Skip to content

Commit

Permalink
Fix links from docs to example
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaanm committed May 16, 2024
1 parent 0716515 commit 8c76f96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion documentation/src/main/paradox/deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Deployer {

- `F[_]`: abstract effectful context `F` encapsulating all values, e.g. `IO[*]`
- `Alg[_[_]]`: algebra allowing interaction with the entity, e.g. @github[BookingAlg\[IO\[*\]\]](/example/src/main/scala/endless/example/algebra/BookingAlg.scala)
- `RepositoryAlg[_[_]]`: repository algebra, e.g. @github[BookingRepositoryAlg\[IO\[*\]\]](/example/src/main/scala/endless/example/repository/BookingRepositoryAlg.scala)
- `RepositoryAlg[_[_]]`: repository algebra, e.g. @github[BookingsAlg\[IO\[*\]\]](/example/src/main/scala/endless/example/algebra/BookingsAlg.scala)
- `ID`: entity ID, e.g. `final case class BookingID(id: UUID) extends AnyVal`
- `S`: entity state, e.g. @github[Booking](/example/src/main/scala/endless/example/data/Booking.scala)
- `E`: entity event, e.g. @github[BookingEvent](/example/src/main/scala/endless/example/data/BookingEvent.scala)
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/main/paradox/effector.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ An effective alternative to using a projection is to track process completion in

By enabling [*remember-entities*](https://pekko.apache.org/docs/pekko/current/typed/cluster-sharding.html#remembering-entities), we can achieve guaranteed *at-least-once* completion of asynchronous processes thanks to effector running right after recovery (thus withstanding node crash or shard rebalancing).

*endless* makes it easy to implement this pattern with `Self`. Here's the recipe, as illustrated in the example application @github[example](/example/src/main/scala/endless/example/logic/BookingEffector.scala):
*endless* makes it easy to implement this pattern with `Self`. Here's the recipe, as illustrated in the example application @github[example](/example/src/main/scala/endless/example/logic/BookingSideEffect.scala):

1. `BookingPlaced` event gets persisted. At this point, entity state represents pending acceptation of the booking `Booking(..., status = Pending)`
2. Effector function inspects the state, and in case of `Pending` status, asks a third-party service for availability and notifies the entity of the result:
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/main/paradox/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait EventWriter[F[_], E] {
trait Entity[F[_], S, E] extends StateReader[F, S] with EventWriter[F, E]
```

@scaladoc[Entity](endless.core.entity.Entity) is parametrized with entity state `S` and events `E`. It is a typeclass which represents reader-writer capabilities for `F` with event-sourcing semantics, i.e. the abilities to read current entity state from the context and persist events. `Entity` is used to describe entity behavior (e.g. @github[BookingEntity](/example/src/main/scala/endless/example/logic/BookingEntity.scala)).
@scaladoc[Entity](endless.core.entity.Entity) is parametrized with entity state `S` and events `E`. It is a typeclass which represents reader-writer capabilities for `F` with event-sourcing semantics, i.e. the abilities to read current entity state from the context and persist events. `Entity` is used to describe entity behavior (e.g. @github[BookingEntityBehavior](/example/src/main/scala/endless/example/logic/BookingEntityBehavior.scala)).

## Functional event sourcing
*Reader-writer* is a natural fit for describing event sourcing behavior: the monadic chain represents event sequencing and corresponding evolution of the state (see also [here](https://pavkin.ru/aecor-part-2/) and [here](https://www.youtube.com/watch?v=kDkRRkkVlxQ)).
Expand Down

0 comments on commit 8c76f96

Please sign in to comment.