StreamState

sec.StreamState
See theStreamState companion object
sealed trait StreamState

The expected state that a stream is currently in. There are four variants:

==Use Cases==

When you write to a stream for the first time you provide StreamState.NoStream. In order to decide if StreamState.NoStream is required you can try to read from the stream and if the read operation raises sec.api.exceptions.StreamNotFound you know that your expectation should be StreamState.NoStream.

When you do not have any expectation of the current state of a stream you should use StreamState.Any. This is, for instance, used when you just wish to append data to a stream regardless of other concurrent operations to the stream.

When you require that a stream, or its metadata stream, is present you should use StreamState.StreamExists.

When you need to implement optimistic concurrency you use StreamPosition.Exact and StreamState.NoStream as your exected stream state. You use StreamState.NoStream as expected stream state when you append to a stream for the first time, otherwise you use an StreamPosition.Exact value. A sec.api.exceptions.WrongExpectedState exception is rasised when the stream exists and has changed in the meantime.

Attributes

Companion:
object
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Exact
object Any.type
object NoStream.type
object StreamExists.type

Members list

Concise view

Value members

Concrete methods

Implicitly added by StreamStateOps

Attributes

Source:
position.scala

Concrete fields

Implicitly added by StreamStateOps

Attributes

Source:
position.scala