Packages

trait Streams[F[_]] extends AnyRef

API for interacting with streams in EventStoreDB.

Main operations

  • subscribing to the global stream or an individual stream.
  • reading from the global stream or an individual stream.
  • appending event data to an existing stream or creating a new stream.
  • deleting events from a stream.
F

the effect type in which Streams operates.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Streams
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def appendToStream(streamId: StreamId, expectedState: StreamState, data: NonEmptyList[EventData]): F[WriteResult]

    Appends EventData to a stream and returns WriteResult with current positions of the stream after a successful operation.

    Appends EventData to a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

    streamId

    the id of the stream to append to.

    expectedState

    the state that the stream is expected to in. See StreamState for details.

    data

    event data to be appended to the stream. See EventData.

    See also

    https://ahjohannessen.github.io/sec/docs/writing for details about appending to a stream.

  2. abstract def delete(streamId: StreamId, expectedState: StreamState): F[DeleteResult]

    Deletes a stream and returns DeleteResult with current log position after a successful operation.

    Deletes a stream and returns DeleteResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.

    streamId

    the id of the stream to delete.

    expectedState

    the state that the stream is expected to in. See StreamState for details.

    Note

    Deleted streams can be recreated.

    See also

    https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to delete a stream.

  3. abstract def readAll(from: LogPosition, direction: Direction, maxCount: Long, resolveLinkTos: Boolean): Stream[F, AllEvent]

    Read events from the global stream, sec.StreamId.All.

    Read events from the global stream, sec.StreamId.All.

    from

    log position to read from.

    direction

    whether to read forwards or backwards.

    maxCount

    limits maximum events returned.

    resolveLinkTos

    whether to resolve EventType.LinkTo events automatically.

    returns

    a Stream that emits AllEvent values.

  4. abstract def readStream(streamId: StreamId, from: StreamPosition, direction: Direction, maxCount: Long, resolveLinkTos: Boolean): Stream[F, StreamEvent]

    Read events from an individual stream.

    Read events from an individual stream. A sec.api.exceptions.StreamNotFound is raised when the stream does not exist.

    streamId

    the id of the stream to subscribe to.

    from

    stream position to read from.

    direction

    whether to read forwards or backwards.

    maxCount

    limits maximum events returned.

    resolveLinkTos

    whether to resolve EventType.LinkTo events automatically.

    returns

    a Stream that emits StreamEvent values.

  5. abstract def subscribeToAll(exclusiveFrom: Option[LogPosition], filterOptions: SubscriptionFilterOptions, resolveLinkTos: Boolean): Stream[F, Either[Checkpoint, AllEvent]]

    Subscribes to the global stream, StreamId.All using a subscription filter.

    Subscribes to the global stream, StreamId.All using a subscription filter.

    exclusiveFrom

    log position to start from. Use None to subscribe from the beginning.

    filterOptions

    to use when subscribing - See sec.api.SubscriptionFilterOptions.

    resolveLinkTos

    whether to resolve EventType.LinkTo events automatically.

    returns

    a Stream that emits either Checkpoint or AllEvent values. How frequent Checkpoint is emitted depends on filterOptions.

  6. abstract def subscribeToAll(exclusiveFrom: Option[LogPosition], resolveLinkTos: Boolean): Stream[F, AllEvent]

    Subscribes to the global stream, StreamId.All.

    Subscribes to the global stream, StreamId.All.

    exclusiveFrom

    position to start from. Use None to subscribe from the beginning.

    resolveLinkTos

    whether to resolve EventType.LinkTo events automatically.

    returns

    a Stream that emits AllEvent values.

  7. abstract def subscribeToStream(streamId: StreamId, exclusiveFrom: Option[StreamPosition], resolveLinkTos: Boolean): Stream[F, StreamEvent]

    Subscribes to an individual stream.

    Subscribes to an individual stream.

    streamId

    the id of the stream to subscribe to.

    exclusiveFrom

    stream position to start from. Use None to subscribe from the beginning.

    resolveLinkTos

    whether to resolve EventType.LinkTo events automatically.

    returns

    a Stream that emits StreamEvent values.

  8. abstract def tombstone(streamId: StreamId, expectedState: StreamState): F[TombstoneResult]

    Tombstones a stream and returns TombstoneResult with current log position after a successful operation.

    Tombstones a stream and returns TombstoneResult with current log position after a successful operation. Failure to fulfill the expected stated is manifested by raising sec.api.exceptions.WrongExpectedState.

    streamId

    the id of the stream to delete.

    expectedState

    the state that the stream is expected to in. See StreamState for details.

    Note

    Tombstoned streams can *never* be recreated.

    See also

    https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to tombstone a stream.

  9. abstract def withCredentials(creds: UserCredentials): Streams[F]

    Returns an instance that uses provided UserCredentials.

    Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.

    creds

    Custom user credentials to use.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped