receiveMessage

suspend fun <M : AgentMessage> KSLProcessBuilder.receiveMessage(mailbox: AgentModel.AgentMailbox<M>, suspensionName: String? = null, predicate: (M) -> Boolean = { true }): M(source)

Suspend until a message matching predicate is available in mailbox, then return it. Default predicate matches anything.

If pending already contains a matching message, returns it immediately without suspending. Otherwise the calling entity is parked via a per-call ksl.modeling.entity.ProcessModel.Entity.Suspension, and the matching sendMessage from another agent will resume it directly.