public abstract class Materializer
extends java.lang.Object
Binary compatibility is NOT guaranteed on materializer internals.
Custom materializer implementations should be aware that the materializer SPI is not yet final and may change in patch releases of Akka. Please note that this does not impact end-users of Akka streams, only implementors of custom materializers, with whom the Akka team co-ordinates such changes.
Once the SPI is final this notice will be removed.
Constructor and Description |
---|
Materializer() |
Modifier and Type | Method and Description |
---|---|
abstract scala.concurrent.ExecutionContextExecutor |
executionContext()
Running a flow graph will require execution resources, as will computations
within Sources, Sinks, etc.
|
abstract <Mat> Mat |
materialize(Graph<ClosedShape,Mat> runnable)
This method interprets the given Flow description and creates the running
stream.
|
abstract <Mat> Mat |
materialize(Graph<ClosedShape,Mat> runnable,
Attributes initialAttributes)
This method interprets the given Flow description and creates the running
stream using an explicitly provided
Attributes as top level attributes. |
abstract Cancellable |
scheduleOnce(scala.concurrent.duration.FiniteDuration delay,
java.lang.Runnable task)
Interface for stages that need timer services for their functionality.
|
abstract Cancellable |
schedulePeriodically(scala.concurrent.duration.FiniteDuration initialDelay,
scala.concurrent.duration.FiniteDuration interval,
java.lang.Runnable task)
Interface for stages that need timer services for their functionality.
|
abstract Materializer |
withNamePrefix(java.lang.String name)
The
namePrefix shall be used for deriving the names of processing
entities that are created during materialization. |
public abstract Materializer withNamePrefix(java.lang.String name)
namePrefix
shall be used for deriving the names of processing
entities that are created during materialization. This is meant to aid
logging and failure reporting both during materialization and while the
stream is running.name
- (undocumented)public abstract <Mat> Mat materialize(Graph<ClosedShape,Mat> runnable)
runnable
- (undocumented)public abstract <Mat> Mat materialize(Graph<ClosedShape,Mat> runnable, Attributes initialAttributes)
Attributes
as top level attributes. The result can be highly
implementation specific, ranging from local actor chains to remote-deployed processing networks.runnable
- (undocumented)initialAttributes
- (undocumented)public abstract scala.concurrent.ExecutionContextExecutor executionContext()
ExecutionContextExecutor
can be used by parts of the flow to submit processing jobs for execution,
run Future callbacks, etc.public abstract Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
delay
- (undocumented)task
- (undocumented)Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event
has been already enqueued it will not have an effect.public abstract Cancellable schedulePeriodically(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
initialDelay
- (undocumented)interval
- (undocumented)task
- (undocumented)Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event
has been already enqueued it will not have an effect.