Module 21: Async Client
The reactive, non-blocking version of Module 01.What You’ll Learn
AcpClient.async()instead ofAcpClient.sync()- Chaining operations with
MonoandflatMap - Async session update consumers returning
Mono<Void> - When to use async vs sync
The Code
Sync vs Async Comparison
The async client wraps every operation in Project Reactor’s
Mono. If you’re already using a reactive framework, the async client integrates naturally. For CLI tools and scripts, the sync client is simpler.
Alternative: block()
For scripts where you want async types but don’t care about non-blocking I/O:Source Code
View on GitHubRunning the Example
Requires the Grok CLI on yourPATH, signed in once with grok login. The module launches it as grok agent stdio; no API key is needed.