Handler
zio.blocks.projection.Handler
final case class Handler[E, A](eventClass: Class[E], schema: Schema[E], tag: String, fn: (E, ProjectionContext) => ProjectionAction[A])
Says what to do when an event of type E arrives: a function from the event and its ProjectionContext to a ProjectionAction on the projected type A.
Handlers are created by HandlerBuilder, not by hand. They contain no effects: a handler only describes the change, and the engine applies it.
Value parameters
- eventClass
-
the runtime class used to recognise events this handler is for
- fn
-
turns an event into the action to apply
- schema
-
the schema of the event type
- tag
-
the name of the event type, used in messages
Attributes
- Source
- Projection.scala
- Graph
-
- Supertypes
Members list
In this article