Skip to content

ticker v1.0.0

Latest

Choose a tag to compare

@iamjosephmj iamjosephmj released this 11 Jul 10:44
· 10 commits to main since this release

🕹️ READY! PLAYER ONE

First release of ticker — kernel-aligned wall-clock ticks for Android. Zero threads. One function.

ticker(Dispatchers.IO) { readStats() }                          // 1 Hz, on IO
ticker(Dispatchers.Default, period = 250.milliseconds) { it }   // 4 Hz

✨ Power pellets

  • Kernel-alignedtimerfd armed absolutely on CLOCK_REALTIME boundaries, woken by the main looper's own epoll_wait. Measured 36–924µs boundary accuracy on a Pixel 6 Pro.
  • Zero threads, zero drift, zero idle cost — no thread is created, expiries are absolute, and when nobody collects, the fd doesn't exist.
  • Clock-change awareTFD_TIMER_CANCEL_ON_SET fires a corrective tick the moment the user sets the clock.
  • Cold, conflated, fail-fast Flow with the per-tick dispatcher baked into the API.
  • ~7KB native lib per ABI — STL-free, R8 consumer rules included. Only dependency: kotlinx-coroutines.
  • minSdk 24, verified by an instrumented suite (lifecycle, flow semantics, fd-leak, zero-thread proof) running in CI on API 24 and 34 emulators.

🪙 Insert coin

Attached: ticker-1.0.0.aar. Drop it in libs/ and add implementation(files("libs/ticker-1.0.0.aar")), or build from source.

GAME OVER? NO — TICK FOREVER.