sealed trait Accumulator[-E, +A] extends AnyRef
An accumulator of elements into a future of a result.
This is essentially a lightweight wrapper around a Sink that gets materialised to a Future, but provides convenient methods for working directly with that future as well as transforming the input.
- Source
- Accumulator.scala
- Alphabetic
- By Inheritance
- Accumulator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
asJava: libs.streams.Accumulator[E, A]
Convert this accumulator to a Java Accumulator.
Convert this accumulator to a Java Accumulator.
- returns
The Java accumulator.
-
abstract
def
map[B](f: (A) ⇒ B)(implicit executor: ExecutionContext): Accumulator[E, B]
Map the result of this accumulator to something else.
-
abstract
def
mapFuture[B](f: (A) ⇒ Future[B])(implicit executor: ExecutionContext): Accumulator[E, B]
Map the result of this accumulator to a future of something else.
-
abstract
def
recover[B >: A](pf: PartialFunction[Throwable, B])(implicit executor: ExecutionContext): Accumulator[E, B]
Recover from errors encountered by this accumulator.
-
abstract
def
recoverWith[B >: A](pf: PartialFunction[Throwable, Future[B]])(implicit executor: ExecutionContext): Accumulator[E, B]
Recover from errors encountered by this accumulator.
-
abstract
def
run(elem: E)(implicit materializer: Materializer): Future[A]
Run this accumulator by feeding a single element into it.
-
abstract
def
run()(implicit materializer: Materializer): Future[A]
Run this accumulator by feeding nothing into it.
-
abstract
def
run(source: Source[E, _])(implicit materializer: Materializer): Future[A]
Run this accumulator by feeding in the given source.
-
abstract
def
through[F](flow: Flow[F, E, _]): Accumulator[F, A]
Return a new accumulator that first feeds the input through the given flow before it goes through this accumulator.
-
abstract
def
toSink: Sink[E, Future[A]]
Convert this accumulator to a Sink that gets materialised to a Future.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
~>:(source: Source[E, _])(implicit materializer: Materializer): Future[A]
Right associative operator alias for run.
Right associative operator alias for run.
This can be used for a more fluent DSL that matches the flow of the data, for example:
val intAccumulator: Accumulator[Int, Int] = ... val source = Source(1 to 3) val intFuture = source ~>: intAccumulator
-
def
~>:[F](flow: Flow[F, E, _]): Accumulator[F, A]
Right associative operator alias for through.
Right associative operator alias for through.
This can be used for a more fluent DSL that matches the flow of the data, for example:
val intAccumulator: Accumulator[Int, Unit] = ... val toInt = Flow[String].map(_.toInt) val stringAccumulator = toInt ~>: intAccumulator