receiveMessageOfTypeOrTimeout

inline suspend fun <T : M, M : AgentMessage> KSLProcessBuilder.receiveMessageOfTypeOrTimeout(mailbox: AgentModel.AgentMailbox<M>, timeout: Double, timeoutPriority: Int = TIMEOUT_PRIORITY, suspensionName: String? = null): WaitResult<T>(source)

Wait, for at most timeout time units, for a message of type T in mailbox. Messages of other types are left in the mailbox. See receiveMessageOrTimeout.

Return

the message, or that the wait timed out, with the time waited

Parameters

mailbox

the mailbox to receive from

timeout

the time limit; zero or more, or infinite for no limit

timeoutPriority

the priority of the event that ends the wait when the time runs out

suspensionName

a name for the suspension, for tracing