read

abstract suspend fun <T> read(context: C, readFunction: Reader<C, D>.() -> T): T

Read stuff

The function will suspend until a read lock has been acquired. No event will be processed while the readFunction is executed.

Return

whatever the readFunction returns

Parameters

context

including the actorIdentity on whose behalf the read happens. This actor can be overridden inside readFunction (see Reader).

readFunction

a function literal with a Reader receiver

Throws

if the actor tries to read a model it is not authorized to access