receiveMessageOfType

inline suspend fun <T : M, M : AgentMessage> KSLProcessBuilder.receiveMessageOfType(mailbox: AgentModel.AgentMailbox<M>, suspensionName: String? = null): T(source)

Suspend until a message of type T arrives in mailbox, then return it. Useful for handlers that key off the performative type.

val request = receiveMessageOfType<AgentMessage.Request<TaskOffer>, AgentMessage>(myMailbox)