All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aecor.runtime.EventJournal.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
package aecor.runtime

import aecor.data.EntityEvent
import cats.data.NonEmptyChain
import fs2.Stream

/**
  * Describes abstract event journal.
  *
  * It is expected that sequence number of the first event is 1.
  *
  * @tparam F - effect type
  * @tparam K - entity key type
  * @tparam E - event type
  */
trait EventJournal[F[_], K, E] {
  def append(key: K, offset: Long, events: NonEmptyChain[E]): F[Unit]
  def read(key: K, offset: Long): Stream[F, EntityEvent[K, E]]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy