monitor

fun AgentMailClient.monitor(inboxId: String, scope: CoroutineScope = CoroutineScope(Dispatchers.Default + SupervisorJob()), block: MonitorBuilder.() -> Unit): Job

Starts a coroutine that polls an inbox for new messages and invokes handlers.