Mission: Become the standard solution for clean, leak-free platform interop in Kotlin Multiplatform projects.
- Singleton API:
register,dispatch,unregister - WeakReference registry — zero memory leaks
- Sticky queue — events survive screen rotation
- Main-thread dispatch (Android Looper + iOS GCD)
- Thread-safe with per-instance reentrant locks
- Debug tools:
dump(),getDebugInfo()
- Thread safety improvements
- Stress-tested with 100k+ concurrent operations
- Enhanced test coverage
KRelay.create("ScopeName")— isolated instances per moduleKRelay.builder(...)— configurable queue size, expiry, debug mode- DI-friendly: inject
KRelayInstanceinto ViewModels - No feature conflicts in multi-module / Super App architectures
- 100% backward compatible with v1.x
- Built-in
KRelayEffect<T>andrememberKRelayImpl<T>Compose helpers KRelay.instancepublic property for cross-module access- Scope Token API:
scopedToken()/cancelScope(token)for per-ViewModel cleanup - Persistent Dispatch:
dispatchPersisted<T>()+SharedPreferencesPersistenceAdapter+NSUserDefaultsPersistenceAdapter - 237 unit tests (JVM + iOS Simulator) + 19 instrumented tests (real device)
- CI/CD via GitHub Actions
- Fixed: KRelayMetrics wiring, iOS KClass bridging, Voyager lifecycle crash, Android 15+ 16KB page alignment
- JVM Desktop support (Compose Desktop — Windows, macOS, Linux)
- Kotlin/JS and Kotlin/Wasm targets
KRelayMetricsdashboard: dispatch rate, queue depth, replay count- Structured logging with configurable sinks
- Integration with popular monitoring tools
No breaking changes are currently planned. If a v3 happens, a full migration guide will be provided well in advance.
These will never be added to keep KRelay focused:
| Feature | Why Not |
|---|---|
| Suspend function / return values | Use expect/actual or suspend fun |
| State management | Use StateFlow |
| Built-in DI | Use Koin / Hilt / kotlin-inject |
| Background processing | Use Dispatchers.IO / WorkManager |
| Two-way communication | Use Repository + callbacks |
Issues, PRs, and discussions are welcome at github.com/brewkits/KRelay.
Current Version: v2.1.0 · Last Updated: 2026-03-16