execute

fun <T> execute(task: () -> T): T?

Executing the task on sdk thread. The task will run async on sdk thread. If callee thread is different than sdk thread then it will wait until task finishes. If callee thread is the same with sdk thread then the task will run immediately.

Return

the result of the task.

Parameters

task

the job that will be executed on the engine thread once is free.


fun <T> execute(task: () -> T, maxWaitMs: Long): T?

Executing the task on sdk thread. The task will run async on sdk thread. If callee thread is different than sdk thread then it will wait until task finishes. If callee thread is the same with sdk thread then the task will run immediately.

Return

the result of the task.

Parameters

task

The job that will be executed on the engine thread once is free.

maxWaitMs

Maximum time to wait for result.