Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix links from docs to example #336

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading