v0.1.0 — first public release
Thread-safe, zero-GC relay for native async callbacks in Unity — dispatched on the main thread, one request ↔ one result.
Highlights
- Core relay: seed (Interlocked) + pending table + double-buffer queue (lock holds only an O(1) swap) + per-frame main-thread dispatch + timeout cleanup.
- Pure-C# core (
RelayPump) with no UnityEngine dependency; a thinMainThreadDispatcherMonoBehaviour shell. - Robustness: end-to-end request timeout,
Bridge.Disposefails pending withDisposed(no leak), idempotent. - Runs the moment you clone it: pure-C#
MockChannel(no device/key/network). Samples: Basic Mock Demo + ASR Demo (IMGUI, zero extra deps). - Verified on Unity 6: EditMode 36/36, PlayMode 3/3 (incl. 1000-request stress + steady-state zero-GC assertions).
Install
Unity Package Manager → Add package from git URL:
```
https://github.com/forestlii/NativeRelay.git#v0.1.0
```
Requires Unity 6 (6000.4)+. See the README for a 30-second quick start and how to plug in a real native channel.
MIT License · © 2026 Likeon