core / pragma.jobs / BackgroundManager / serialActor /

serialActor #

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

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

This guarantees the block is run once for every element in the order they are received.

Parameters #

channel

The channel that triggers the block of code.

block

The block of code to be executed.