core / pragma.jobs / BackgroundManager / parallelActor /

parallelActor #

abstract fun <T> parallelActor(channel: ReceiveChannel<T>, block: suspend (T) -> Unit)

Runs the block of code on a new coroutine every time an element is received on channel.

These blocks are run concurrently.

Parameters #

channel

The channel that triggers the block of code.

block

The block of code to be executed.