PravegaStream

zio.pravega.PravegaStream
See thePravegaStream companion trait
object PravegaStream

Pravega Stream API.

This API is a wrapper around the Pravega Java API.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Grouped members

Read

These methods are used to read from a stream.

def eventStream[A](readerGroupName: String, settings: ReaderSettings[A]): ZStream[PravegaStream, Throwable, EventRead[A]]

Stream of events. See zio.pravega.PravegaStream.eventStream.

Stream of events. See zio.pravega.PravegaStream.eventStream.

Attributes

def stream[A](readerGroupName: String, settings: ReaderSettings[A]): ZStream[PravegaStream, Throwable, A]

Stream of elements. See zio.pravega.PravegaStream.stream.

Stream of elements. See zio.pravega.PravegaStream.stream.

Attributes

Write

These methods are used to write to a stream, in atomic (transactional) or best effort mode.

def joinTransaction[A](streamName: String, settings: WriterSettings[A], txUUID: UUID, commitOnClose: Boolean): ZSink[PravegaStream, Throwable, A, Nothing, Unit]

Sink that writes to an already opened transactional stream.

Sink that writes to an already opened transactional stream.

  • The transaction id is provided by the caller.
  • The transaction may be committed by the writer.
  • The transaction is aborted by the writer in case of failure.

May commit the transaction on closing.

Attributes

def openTransaction[A](streamName: String, settings: WriterSettings[A]): ZIO[PravegaStream, Throwable, UUID]

Open a transaction, and return its UUID. See zio.pravega.PravegaStream.writeUncommited.

Open a transaction, and return its UUID. See zio.pravega.PravegaStream.writeUncommited.

Attributes

def sink[A](streamName: String, settings: WriterSettings[A]): ZSink[PravegaStream, Throwable, A, Nothing, Unit]

Sink that writes to a stream. See zio.pravega.PravegaStream.sink.

Sink that writes to a stream. See zio.pravega.PravegaStream.sink.

This sink is not transactional, and does not guarantee that the events are written atomically.

Attributes

def sinkAtomic[A](streamName: String, settings: WriterSettings[A]): ZSink[PravegaStream, Throwable, A, Nothing, Unit]

Sink that writes to a transactional stream.

Sink that writes to a transactional stream.

This sink is transactional, and guarantee that the events are written atomically, when the sink is closed.

Attributes

def sinkUncommited[A](streamName: String, settings: WriterSettings[A]): ZSink[PravegaStream, Throwable, A, Nothing, UUID]

Sink that writes to a transactional stream.

Sink that writes to a transactional stream.

  • The transaction id is generated by the writer, once the transaction is created.
  • The transaction is not committed
  • The transaction is aborted by the writer in case of failure.

It is the responsibility of the caller to commit the transaction see zio.pravega.PravegaStream.joinTransaction.

Attributes

def write[A](streamName: String, settings: WriterSettings[A], a: A*): ZIO[PravegaStream, Throwable, Unit]

Writes atomicaly to a stream. See zio.pravega.PravegaStream.write.

Writes atomicaly to a stream. See zio.pravega.PravegaStream.write.

Attributes

def writeFlow[A](streamName: String, settings: WriterSettings[A]): ZPipeline[PravegaStream, Throwable, A, A]

Creates a ZPipeline that writes to a stream.

Creates a ZPipeline that writes to a stream.

Attributes

def writeUncommited[A](streamName: String, settings: WriterSettings[A], a: A*): ZIO[PravegaStream, Throwable, UUID]

Writes to a stream transactional stream.

Writes to a stream transactional stream.

Transaction:

  • is created and return when all item are written.
  • will be aborted in case of failure.
  • will not be committed.

It is the responsibility of the caller to commit the transaction see zio.pravega.PravegaStream.writeUncommited.

Attributes

ZLayer

ZLayer creation.

def fromScope(scope: String): ZLayer[Scope & ClientConfig, Throwable, PravegaStream]

Creates a Pravega stream Service from a scope.

Creates a Pravega stream Service from a scope.

Requires a ClientConfig to be provided in the environment.

Attributes

def fromScope(scope: String, clientConfig: ClientConfig): ZLayer[Scope, Throwable, PravegaStream]

Creates a Pravega stream Service from a scope.

Creates a Pravega stream Service from a scope.

Attributes