Urgent.News

What's breaking now, across thousands of outlets.

Tech

How Ballast Powers Vesper’s Kotlin Multiplatform Architecture

See how Ballast powers Vesper’s Kotlin Multiplatform architecture across UI state, navigation, saved state, server queues, and scheduled jobs.

How Ballast Powers Vesper’s Kotlin Multiplatform Architecture

Ballast is a crucial part of the Vesper app's architecture, serving as the Kotlin-language interface to server-side schedules and background queue workloads. Written by the author, Ballast was designed to solve specific problems and has been the foundation for Vesper's production-grade Kotlin Multiplatform (KMP) app. The source material explains how Ballast differs from the popular Redux library by leveraging Kotlin's sealed interfaces and Coroutines, while maintaining safety and flexibility.

A Ballast Contract defines the State, Inputs, and Events for a screen, enabling a highly opinionated yet adaptable code structure. In the example of a Stopwatch, the Contract outlines the State (elapsedSeconds and isRunning), and Inputs (Start, Stop, Reset, and Tick). The InputHandler processes these inputs to update the State or schedule additional work, while the ViewModel coordinates the lifecycle using a CoroutineScope.

The code is explicit and directly navigable, avoiding the use of code generation or reflection, which can be uneven on Kotlin Multiplatform. This approach results in a consistent, debuggable, and easily modifiable codebase.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

Can My AWS EKS Cluster Handle 100,000 Users? Load Testing + Autoscaling, Proven Live

Part 2 of a 4-part series — this article covers the repo at tag v2.0-load-testing-autoscaling. Part 1 (EKS deployment, tag v1.0-eks-deployment) is here .

  • Verified metrics-server before trusting HPA for scaling
  • Karpenter removes node-group ceiling but requires EC2NodeClass constraints
  • Watching load test end-to-end crucial for autoscaling validation

More from Friday 4 September →