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.
Type parameters
- F
-
the effect type in which Streams operates.
Attributes
- Companion
- object
- Source
- streams.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
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.
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.
Value parameters
- data
-
event data to be appended to the stream. See EventData.
- expectedState
-
the state that the stream is expected to in. See StreamState for details.
- streamId
-
the id of the stream to append to.
Attributes
- See also
-
https://ahjohannessen.github.io/sec/docs/writing for details about appending to a stream.
- Source
- streams.scala
Deletes a stream and returns DeleteResult with current log position after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
Deletes a stream and returns DeleteResult with current log position after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
Value parameters
- expectedState
-
the state that the stream is expected to in. See StreamState for details.
- streamId
-
the id of the stream to delete.
Attributes
- See also
-
https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to delete a stream.
- Note
-
Deleted streams can be recreated.
- Source
- streams.scala
Returns an sec.api.streams.Reads instance. This is useful when you need more granularity from readAll
or readStream
operations.
Returns an sec.api.streams.Reads instance. This is useful when you need more granularity from readAll
or readStream
operations.
Attributes
- Source
- streams.scala
Read events from the global stream, sec.StreamId.All.
Read events from the global stream, sec.StreamId.All.
Value parameters
- direction
-
whether to read forwards or backwards.
- from
-
log position to read from.
- maxCount
-
limits maximum events returned.
- resolveLinkTos
-
whether to resolve EventType.LinkTo events automatically.
Attributes
- Returns
-
a fs2.Stream that emits Event values.
- Source
- streams.scala
Read events from an individual stream. A sec.api.exceptions.StreamNotFound is raised when the stream does not exist.
Read events from an individual stream. A sec.api.exceptions.StreamNotFound is raised when the stream does not exist.
Value parameters
- direction
-
whether to read forwards or backwards.
- from
-
stream position to read from.
- maxCount
-
limits maximum events returned.
- resolveLinkTos
-
whether to resolve EventType.LinkTo events automatically.
- streamId
-
the id of the stream to subscribe to.
Attributes
- Returns
-
a fs2.Stream that emits Event values.
- Source
- streams.scala
Subscribes to the global stream, StreamId.All.
Subscribes to the global stream, StreamId.All.
Value parameters
- exclusiveFrom
-
position to start from. Use scala.None to subscribe from the beginning.
- resolveLinkTos
-
whether to resolve EventType.LinkTo events automatically.
Attributes
- Returns
-
a fs2.Stream that emits Event values.
- Source
- streams.scala
Subscribes to the global stream, StreamId.All using a subscription filter.
Subscribes to the global stream, StreamId.All using a subscription filter.
Value parameters
- exclusiveFrom
-
log position to start from. Use scala.None to subscribe from the beginning.
- filterOptions
-
to use when subscribing - See sec.api.SubscriptionFilterOptions.
- resolveLinkTos
-
whether to resolve EventType.LinkTo events automatically.
Attributes
- Returns
-
a fs2.Stream that emits either sec.api.Checkpoint or Event values. How frequent sec.api.Checkpoint is emitted depends on
filterOptions
. - Source
- streams.scala
Subscribes to an individual stream.
Subscribes to an individual stream.
Value parameters
- exclusiveFrom
-
stream position to start from. Use scala.None to subscribe from the beginning.
- resolveLinkTos
-
whether to resolve EventType.LinkTo events automatically.
- streamId
-
the id of the stream to subscribe to.
Attributes
- Returns
-
a fs2.Stream that emits Event values.
- Source
- streams.scala
Tombstones a stream and returns TombstoneResult with current log position after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
Tombstones a stream and returns TombstoneResult with current log position after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.
Value parameters
- expectedState
-
the state that the stream is expected to in. See StreamState for details.
- streamId
-
the id of the stream to delete.
Attributes
- See also
-
https://ahjohannessen.github.io/sec/docs/deleting for details about what it means to tombstone a stream.
- Note
-
Tombstoned streams can never be recreated.
- Source
- streams.scala
Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.
Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.
Value parameters
- creds
-
Custom user credentials to use.
Attributes
- Source
- streams.scala