Package akka.stream
Class Materializer
- java.lang.Object
-
- akka.stream.Materializer
-
- Direct Known Subclasses:
ActorMaterializer
,NoMaterializer$
,SubFusingActorMaterializerImpl
public abstract class Materializer extends java.lang.Object
ThenamePrefix
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.
-
-
Constructor Summary
Constructors Constructor Description Materializer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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 defaultAttributes)
This method interprets the given Flow description and creates the running stream using an explicitly providedAttributes
as top level (least specific) attributes that will be defaults for the materialized stream.static Materializer
matFromSystem(ClassicActorSystemProvider provider)
abstract Cancellable
scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Interface for operators 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 operators that need timer services for their functionality.abstract Materializer
withNamePrefix(java.lang.String name)
-
-
-
Method Detail
-
matFromSystem
public static Materializer matFromSystem(ClassicActorSystemProvider provider)
-
withNamePrefix
public abstract Materializer withNamePrefix(java.lang.String name)
-
materialize
public abstract <Mat> Mat materialize(Graph<ClosedShape,Mat> runnable)
This method interprets the given Flow description and creates the running stream. The result can be highly implementation specific, ranging from local actor chains to remote-deployed processing networks.- Parameters:
runnable
- (undocumented)- Returns:
- (undocumented)
-
materialize
public abstract <Mat> Mat materialize(Graph<ClosedShape,Mat> runnable, Attributes defaultAttributes)
This method interprets the given Flow description and creates the running stream using an explicitly providedAttributes
as top level (least specific) attributes that will be defaults for the materialized stream. The result can be highly implementation specific, ranging from local actor chains to remote-deployed processing networks.- Parameters:
runnable
- (undocumented)defaultAttributes
- (undocumented)- Returns:
- (undocumented)
-
executionContext
public abstract scala.concurrent.ExecutionContextExecutor executionContext()
Running a flow graph will require execution resources, as will computations within Sources, Sinks, etc. ThisExecutionContextExecutor
can be used by parts of the flow to submit processing jobs for execution, run Future callbacks, etc.Note that this is not necessarily the same execution context the stream operator itself is running on.
- Returns:
- (undocumented)
-
scheduleOnce
public abstract Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable task)
Interface for operators that need timer services for their functionality. Schedules a single task with the given delay.- Parameters:
delay
- (undocumented)task
- (undocumented)- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
schedulePeriodically
public abstract Cancellable schedulePeriodically(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval, java.lang.Runnable task)
Interface for operators that need timer services for their functionality. Schedules a repeated task with the given interval between invocations.- Parameters:
initialDelay
- (undocumented)interval
- (undocumented)task
- (undocumented)- Returns:
- A
Cancellable
that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.
-
-