object CompletionStages
CompletionStages provides utilities for working with CompletionStages.
- Source
- CompletionStages.scala
- Alphabetic
- By Inheritance
- CompletionStages
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 asScala[T](stage: CompletionStage[T]): Future[T]
Convert a
CompletionStageto a ScalaFuture. - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def find[T <: AnyRef](stages: Iterable[_ <: CompletionStage[_ <: T]], predicate: Function[T, Boolean]): CompletionStage[Optional[T]]
Return the first
CompletionStagein the givenIterablethat matches the given predicate.Return the first
CompletionStagein the givenIterablethat matches the given predicate. If no stage matches the predicate, an emptyOptionalis returned.- stages
the stages to search through
- predicate
the predicate to apply to each completed stage
- returns
a
CompletionStagethat, when completed, will contain anOptionalwith the first matching element, or an emptyOptionalif none matched
- Since
1.2.0
- def firstCompletedOf[T <: AnyRef](stages: Iterable[_ <: CompletionStage[_ <: T]]): CompletionStage[T]
Returns a new
CompletionStagethat, when completed, will contain the result of the first of the given stages to complete, with the same value or exception.Returns a new
CompletionStagethat, when completed, will contain the result of the first of the given stages to complete, with the same value or exception.If the given iterable is empty, the returned stage never completes.
- stages
the stages
- returns
a
CompletionStagethat, when completed, will contain the result of the first stage to complete with the same value or exception.
- Since
1.2.0
- def fold[T <: AnyRef, R](zero: R, stages: Iterable[_ <: CompletionStage[_ <: T]], function: Function2[R, T, R]): CompletionStage[R]
Aggregate the results of the given stages using the given associative function and a zero value.
Aggregate the results of the given stages using the given associative function and a zero value. The stages are processed in the order they are given.
- zero
the zero value
- stages
the stages to aggregate
- function
the associative function to use for aggregation
- returns
a
CompletionStagethat, when completed, will contain the aggregated result
- Since
1.2.0
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @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
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def reduce[T <: AnyRef, R >: T](stages: Iterable[_ <: CompletionStage[_ <: T]], function: Function2[R, T, R]): CompletionStage[R]
Reduce the results of the given stages using the given associative function.
Reduce the results of the given stages using the given associative function. The stages are processed in the order they are given. If the given iterable is empty, the returned stage is completed with a
NoSuchElementException.- stages
the stages to reduce
- function
the associative function to use for reduction
- returns
a
CompletionStagethat, when completed, will contain the reduced result of the stages or aNoSuchElementExceptionif the given iterable is empty
- Annotations
- @nowarn()
- Since
1.2.0
- def sequence[T](stages: Iterable[_ <: CompletionStage[_ <: T]], executor: Executor): CompletionStage[List[T]]
Transform a
java.lang.IterableofCompletionStages into a singleCompletionStagewith ajava.util.Listof all the results.Transform a
java.lang.IterableofCompletionStages into a singleCompletionStagewith ajava.util.Listof all the results. The stages are processed in the order they are given.- stages
the stages to sequence
- executor
the executor to use for asynchronous execution, or
nullto use synchronous execution- returns
a
CompletionStagethat, when completed, will contain ajava.util.Listwith all the results
- Since
1.2.0
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[T, R](input: Iterable[T], function: Function[T, CompletionStage[R]], executor: Executor): CompletionStage[List[R]]
Transform a
java.lang.IterableofCompletionStages into a singleCompletionStagewith ajava.util.Listof all the results.Transform a
java.lang.IterableofCompletionStages into a singleCompletionStagewith ajava.util.Listof all the results. The stages are processed in the order they are given.- input
the input iterable
- function
the function to apply to each element
- executor
the executor to use for asynchronous execution, or
nullto use synchronous execution- returns
a
CompletionStagethat, when completed, will contain ajava.util.Listwith all the results
- Since
1.2.0
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])