ActorMaterializer

org.apache.pekko.stream.ActorMaterializer
See theActorMaterializer companion object

An ActorMaterializer takes a stream blueprint and turns it into a running stream.

Attributes

Companion
object
Deprecated
true
Source
ActorMaterializer.scala
Graph
Supertypes
class Materializer
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

Indicates if the materializer has been shut down.

Indicates if the materializer has been shut down.

Attributes

Source
ActorMaterializer.scala
def shutdown(): Unit

Shuts down this materializer and all the operators that have been materialized through this materializer. After having shut down, this materializer cannot be used again. Any attempt to materialize operators after having shut down will result in an IllegalStateException being thrown at materialization time.

Shuts down this materializer and all the operators that have been materialized through this materializer. After having shut down, this materializer cannot be used again. Any attempt to materialize operators after having shut down will result in an IllegalStateException being thrown at materialization time.

Attributes

Source
ActorMaterializer.scala

INTERNAL API

INTERNAL API

Attributes

Source
ActorMaterializer.scala

Deprecated methods

Attributes

Deprecated
true
Source
ActorMaterializer.scala

Inherited methods

def makeLogger(logSource: Class[Any]): LoggingAdapter
def materialize[Mat](runnable: Graph[ClosedShape, Mat], defaultAttributes: Attributes): Mat

This method interprets the given Flow description and creates the running stream using an explicitly provided Attributes 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.

This method interprets the given Flow description and creates the running stream using an explicitly provided Attributes 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.

Attributes

Inherited from:
Materializer
Source
Materializer.scala
def materialize[Mat](runnable: Graph[ClosedShape, Mat]): Mat

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.

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.

Attributes

Inherited from:
Materializer
Source
Materializer.scala
def scheduleAtFixedRate(initialDelay: FiniteDuration, interval: FiniteDuration, task: Runnable): Cancellable

Interface for operators that need timer services for their functionality.

Interface for operators that need timer services for their functionality.

Schedules a Runnable to be run repeatedly with an initial delay and a frequency. E.g. if you would like the function to be run after 2 seconds and thereafter every 100ms you would set delay=Duration(2, TimeUnit.SECONDS) and interval=Duration(100, TimeUnit.MILLISECONDS).

It will compensate the delay for a subsequent task if the previous tasks took too long to execute. In such cases, the actual execution interval will differ from the interval passed to the method.

If the execution of the tasks takes longer than the interval, the subsequent execution will start immediately after the prior one completes (there will be no overlap of executions). This also has the consequence that after long garbage collection pauses or other reasons when the JVM was suspended all "missed" tasks will execute when the process wakes up again.

In the long run, the frequency of execution will be exactly the reciprocal of the specified interval.

Warning: scheduleAtFixedRate can result in bursts of scheduled tasks after long garbage collection pauses, which may in worst case cause undesired load on the system. Therefore scheduleWithFixedDelay is often preferred.

If the Runnable throws an exception the repeated scheduling is aborted, i.e. the function will not be invoked any more.

Attributes

Returns

A pekko.actor.Cancellable that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.

Throws
java.lang.IllegalArgumentException

if the given delays exceed the maximum supported by the Scheduler.

Inherited from:
Materializer
Source
Materializer.scala
def scheduleOnce(delay: FiniteDuration, task: Runnable): Cancellable

Interface for operators that need timer services for their functionality. Schedules a single task with the given delay.

Interface for operators that need timer services for their functionality. Schedules a single task with the given delay.

Attributes

Returns

A pekko.actor.Cancellable that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.

Inherited from:
Materializer
Source
Materializer.scala
def scheduleWithFixedDelay(initialDelay: FiniteDuration, delay: FiniteDuration, task: Runnable): Cancellable

Interface for operators that need timer services for their functionality.

Interface for operators that need timer services for their functionality.

Schedules a Runnable to be run repeatedly with an initial delay and a fixed delay between subsequent executions.

It will not compensate the delay between tasks if the execution takes a long time or if scheduling is delayed longer than specified for some reason. The delay between subsequent execution will always be (at least) the given delay. In the long run, the frequency of execution will generally be slightly lower than the reciprocal of the specified delay.

If the Runnable throws an exception the repeated scheduling is aborted, i.e. the function will not be invoked any more.

Attributes

Returns

A pekko.actor.Cancellable that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.

Throws
java.lang.IllegalArgumentException

if the given delays exceed the maximum supported by the Scheduler.

Inherited from:
Materializer
Source
Materializer.scala

The 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.

The 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.

Attributes

Inherited from:
Materializer
Source
Materializer.scala

Deprecated and Inherited methods

def schedulePeriodically(initialDelay: FiniteDuration, interval: FiniteDuration, task: Runnable): Cancellable

Interface for operators that need timer services for their functionality. Schedules a repeated task with the given interval between invocations.

Interface for operators that need timer services for their functionality. Schedules a repeated task with the given interval between invocations.

Attributes

Returns

A pekko.actor.Cancellable that allows cancelling the timer. Cancelling is best effort, if the event has been already enqueued it will not have an effect.

Deprecated
[Since version Akka 2.6.0]
Inherited from:
Materializer
Source
Materializer.scala

Implicits

Inherited implicits

Running a flow graph will require execution resources, as will computations within Sources, Sinks, etc. This scala.concurrent.ExecutionContextExecutor can be used by parts of the flow to submit processing jobs for execution, run Future callbacks, etc.

Running a flow graph will require execution resources, as will computations within Sources, Sinks, etc. This scala.concurrent.ExecutionContextExecutor 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.

Attributes

Inherited from:
Materializer
Source
Materializer.scala