Kactoos

kactoos-jvm / nnl.rocks.kactoos.func / Async / <init>

<init>

Async(proc: Proc<X>, result: Y, fct: ThreadFactory)

Parameters

proc - The proc

fct - FactoryAsync(fnc: Func<X, Y>, fct: ThreadFactory)

Parameters

fnc - The func

fct - FactoryAsync(fnc: Func<X, Y>)Async(func: Func<X, Y>, executor: ExecutorService)

Func that runs in the background.

If you want your piece of code to be executed in the background, use Async as following:

int length = new Async(
  input -> input.length()
).invoke("Hello, world!").get();

There is no thread-safety guarantee.

Parameters

X - Type of input

Y - Type of output

func - The func

executor - Executor Service

Since 0.10