TrackingEventReaction

io.github.positionpal.location.application.tracking.reactions.TrackingEventReaction

A binary short circuit reaction to ClientDrivingEvents producing as an Outcome a Notification (either a Notification.Alert or a Notification.Success).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

case object Continue

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Continue.type

Types

override type Environment = Session

The type of the reaction's environment, i.e., its context.

The type of the reaction's environment, i.e., its context.

Attributes

override type Event = ClientDrivingEvent

The type of the event triggering the reaction.

The type of the event triggering the reaction.

Attributes

override type LeftOutcome = Unit | DrivingEvent

The type of the left outcome, representing a failure.

The type of the left outcome, representing a failure.

Attributes

override type RightOutcome = Continue.type

The type of the right outcome, representing a success.

The type of the right outcome, representing a success.

Attributes

Inherited types

override type Outcome = Either[LeftOutcome, RightOutcome]

The outcome of the reaction application, i.e., the result of the reaction.

The outcome of the reaction application, i.e., the result of the reaction.

Attributes

Inherited from:
BinaryShortCircuitReaction

Inherited and Abstract types

opaque type EventReaction[F[_]]

A computational reaction to an Event within a given Environment, abstracted over an effect F (e.g., IO, Task, etc.).

A computational reaction to an Event within a given Environment, abstracted over an effect F (e.g., IO, Task, etc.).

Attributes

Inherited from:
EventReactionADT

Value members

Inherited methods

def on[F[_]](reaction: ((Environment, Event)) => F[Outcome]): EventReaction[F]

Creates an EventReaction from the provided effectful reaction function.

Creates an EventReaction from the provided effectful reaction function.

Type parameters

F

the effect type of the reaction.

Attributes

Returns

the created EventReaction.

Inherited from:
EventReactionADT

Extensions

Inherited extensions

extension [F[_]](reaction: EventReaction[F])(using evidence$1: Monad[F])
def apply: F[Outcome]

Executes the event reaction by applying the provided environment and event, resulting in an Outcome wrapped in the effect type F[_]. The computation is deferred and executed within the effect context.

Executes the event reaction by applying the provided environment and event, resulting in an Outcome wrapped in the effect type F[_]. The computation is deferred and executed within the effect context.

Value parameters

environment

the Environment (context) in which the event reaction computation occurs

event

the Event triggering the reaction

Attributes

Returns

an effect F containing the resulting Outcome of processing the event.

Inherited from:
EventReactionADT
extension [F[_]](reaction: EventReaction[F])(using evidence$1: Monad[F])
def when(predicate: (Environment, Event) => Boolean): EventReaction[F]

Filters the execution of the reaction based on the provided predicate function, which determines whether the reaction should be executed or the provided default outcome should be returned instead.

Filters the execution of the reaction based on the provided predicate function, which determines whether the reaction should be executed or the provided default outcome should be returned instead.

Value parameters

predicate

a function that evaluates to true if the reaction should be executed

Attributes

Returns

a new EventReaction that only runs if the predicate condition is satisfied.

Inherited from:
FilterableOps
extension [F[_]](reaction: EventReaction[F])(using evidence$1: Monad[F])
def >>>: EventReaction[F]

Composes two EventReactions by chaining their execution, running this reaction first, followed by the provided other reaction, within the effectful context F.

Composes two EventReactions by chaining their execution, running this reaction first, followed by the provided other reaction, within the effectful context F.

Value parameters

other

the EventReaction to execute after this one

Attributes

Returns

a new EventReaction with the combined behavior of the two reactions.

Inherited from:
BinaryShortCircuitReaction