Class StreamUtils$

java.lang.Object
akka.http.impl.util.StreamUtils$

public class StreamUtils$ extends Object
INTERNAL API
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final StreamUtils$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    akka.stream.stage.GraphStage<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>>
    byteStringTransformer(scala.Function1<akka.util.ByteString,akka.util.ByteString> f, scala.Function0<akka.util.ByteString> finish)
    Creates a transformer that will call f for each incoming ByteString and output its result.
    void
    cancelSource(akka.stream.scaladsl.Source<?,?> source, akka.stream.Materializer materializer)
    Tries to guess whether a source needs to cancelled and how.
    <T, Mat> scala.Tuple4<akka.stream.scaladsl.Source<T,Mat>,scala.concurrent.Future<scala.runtime.BoxedUnit>,scala.concurrent.Future<scala.runtime.BoxedUnit>,akka.stream.KillSwitch>
    captureMaterializationTerminationAndKillSwitch(akka.stream.scaladsl.Source<T,Mat> source)
     
    <T, Mat> scala.Tuple2<akka.stream.scaladsl.Source<T,Mat>,scala.concurrent.Future<scala.runtime.BoxedUnit>>
    captureTermination(akka.stream.scaladsl.Source<T,Mat> source)
     
    <T> akka.stream.scaladsl.Flow<T,T,akka.NotUsed>
    delayCancellation(scala.concurrent.duration.Duration cancelAfter)
    INTERNAL API
    <T> akka.stream.scaladsl.Flow<T,T,akka.NotUsed>
    encodeErrorAndComplete(scala.Function1<Throwable,T> f)
     
    akka.stream.stage.GraphStage<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>>
    limitByteChunksStage(int maxBytesPerChunk)
     
    akka.stream.Materializer
    Dummy name to signify that the caller asserts that cancelSource is only run from within a GraphInterpreter context
    akka.stream.scaladsl.Flow<akka.util.ByteString,akka.util.ByteString,akka.NotUsed>
    sliceBytesTransformer(long start, long length)
     
    <T, U> akka.stream.scaladsl.Flow<T,U,akka.NotUsed>
    statefulAttrsMap(scala.Function1<akka.stream.Attributes,scala.Function1<T,U>> functionConstructor)
    Lifts the streams attributes into an element and passes them to the function for each passed through element.
    <T, U> akka.stream.scaladsl.Flow<T,U,akka.NotUsed>
    statefulMap(scala.Function0<scala.Function1<T,U>> functionConstructor)
    Similar idea than FlowOps.statefulMapConcat but for a simple map.
    <T extends HttpEntity, M>
    scala.Tuple2<T,M>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final StreamUtils$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • StreamUtils$

      public StreamUtils$()
  • Method Details

    • byteStringTransformer

      public akka.stream.stage.GraphStage<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>> byteStringTransformer(scala.Function1<akka.util.ByteString,akka.util.ByteString> f, scala.Function0<akka.util.ByteString> finish)
      Creates a transformer that will call f for each incoming ByteString and output its result. After the complete input has been read it will call finish once to determine the final ByteString to post to the output. Empty ByteStrings are discarded.
      Parameters:
      f - (undocumented)
      finish - (undocumented)
      Returns:
      (undocumented)
    • captureTermination

      public <T, Mat> scala.Tuple2<akka.stream.scaladsl.Source<T,Mat>,scala.concurrent.Future<scala.runtime.BoxedUnit>> captureTermination(akka.stream.scaladsl.Source<T,Mat> source)
    • captureMaterializationTerminationAndKillSwitch

      public <T, Mat> scala.Tuple4<akka.stream.scaladsl.Source<T,Mat>,scala.concurrent.Future<scala.runtime.BoxedUnit>,scala.concurrent.Future<scala.runtime.BoxedUnit>,akka.stream.KillSwitch> captureMaterializationTerminationAndKillSwitch(akka.stream.scaladsl.Source<T,Mat> source)
    • sliceBytesTransformer

      public akka.stream.scaladsl.Flow<akka.util.ByteString,akka.util.ByteString,akka.NotUsed> sliceBytesTransformer(long start, long length)
    • limitByteChunksStage

      public akka.stream.stage.GraphStage<akka.stream.FlowShape<akka.util.ByteString,akka.util.ByteString>> limitByteChunksStage(int maxBytesPerChunk)
    • delayCancellation

      public <T> akka.stream.scaladsl.Flow<T,T,akka.NotUsed> delayCancellation(scala.concurrent.duration.Duration cancelAfter)
      INTERNAL API

      Returns a flow that is almost identity but delays propagation of cancellation from downstream to upstream.

      Parameters:
      cancelAfter - (undocumented)
      Returns:
      (undocumented)
    • statefulMap

      public <T, U> akka.stream.scaladsl.Flow<T,U,akka.NotUsed> statefulMap(scala.Function0<scala.Function1<T,U>> functionConstructor)
      Similar idea than FlowOps.statefulMapConcat but for a simple map.
      Parameters:
      functionConstructor - (undocumented)
      Returns:
      (undocumented)
    • statefulAttrsMap

      public <T, U> akka.stream.scaladsl.Flow<T,U,akka.NotUsed> statefulAttrsMap(scala.Function1<akka.stream.Attributes,scala.Function1<T,U>> functionConstructor)
      Lifts the streams attributes into an element and passes them to the function for each passed through element. Similar idea than FlowOps.statefulMapConcat but for a simple map.

      The result of Attributes => (T => U) is cached, and only the T => U function will be invoked afterwards for each element.

      Parameters:
      functionConstructor - (undocumented)
      Returns:
      (undocumented)
    • OnlyRunInGraphInterpreterContext

      public akka.stream.Materializer OnlyRunInGraphInterpreterContext()
      Dummy name to signify that the caller asserts that cancelSource is only run from within a GraphInterpreter context
    • cancelSource

      public void cancelSource(akka.stream.scaladsl.Source<?,?> source, akka.stream.Materializer materializer)
      Tries to guess whether a source needs to cancelled and how. In the best case no materialization should be needed.
      Parameters:
      source - (undocumented)
      materializer - (undocumented)
    • transformEntityStream

      public <T extends HttpEntity, M> scala.Tuple2<T,M> transformEntityStream(T entity, StreamUtils.EntityStreamOp<M> streamOp)
    • encodeErrorAndComplete

      public <T> akka.stream.scaladsl.Flow<T,T,akka.NotUsed> encodeErrorAndComplete(scala.Function1<Throwable,T> f)