final class BatchedFunction[A, B] extends (Seq[A]) ⇒ Future[B] with Pauseable
Helper to batch multiple asynchronous requests and ensure only one request is active at a time.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- BatchedFunction
- Pauseable
- Function1
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
-
new
BatchedFunction(fn: (Seq[A]) ⇒ CancelableFuture[B])(implicit ec: ExecutionContext)
- fn
the function to batch. It must be safe to group together arguments from different requests into a single request and respond to the aggregated requests with the aggregated response.
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
-
def
andThen[A](g: (Future[B]) ⇒ A): (Seq[A]) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(argument: A): Future[B]
-
def
apply(arguments: Seq[A]): Future[B]
Call the function with the given arguments.
Call the function with the given arguments.
It is safe to rapidly call this function multiple times. The first call triggers the function and subsequent arguments will be batched up together for another run once the first asynchronous call completes.
- returns
the response from calling the batched function with potentially previously and/or subsequently batched arguments.
- Definition Classes
- BatchedFunction → Function1
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def cancelCurrentRequest(): Unit
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose[A](g: (A) ⇒ Seq[A]): (A) ⇒ Future[B]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def currentFuture(): Future[B]
-
def
doPause(): Unit
- Definition Classes
- Pauseable
-
def
doUnpause(): Unit
- Definition Classes
- BatchedFunction → Pauseable
-
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
val
isPaused: AtomicBoolean
- Definition Classes
- Pauseable
-
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
pause(): Unit
- Definition Classes
- Pauseable
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
unpause(): Unit
- Definition Classes
- Pauseable
-
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()