qisdk / com.aldebaran.qi.sdk.util / FutureUtils

FutureUtils

open class FutureUtils

Utility methods used for work with futures

Constructors

<init>

Utility methods used for work with futures

FutureUtils()

Functions

autoLog

Returns a future that log errors and cancel

open static fun <T : Any!> autoLog(future: Future<T>!, futureMessage: String!): Future<T>!

futureOf

Return a Future of a Function

open static fun <R : Any!> futureOf(function: Function<Future<Void!>!, Future<R>!>!): Future<R>!

Return a Future of a Consumer

open static fun futureOf(consumer: Consumer<Future<Void!>!>!): Future<Void!>!

get

open static fun <T : Any!> get(future: Future<T>!): T

hasAlreadyFailed

Check if a future has already failed

open static fun hasAlreadyFailed(future: Future<*>!): Boolean

wait

Returns a future that wait a delay to finish

open static fun wait(delay: Long, timeUnit: TimeUnit!): Future<Void!>!

zip

Returns a future that transform a list of future into a future of list

open static fun <T : Any!> zip(vararg futures: Future<T>!): Future<MutableList<T>!>!
open static fun <T : Any!> zip(futures: MutableList<Future<T>!>!): Future<MutableList<T>!>!