Skip to main content

Android custom streaming responses

The standalone Android host provides Responder.frame(bytes) for an application's Transport to deliver successive WebSocket live-source messages. Scripts keep source.sqs.connectLive({transport:{type:'websocket',url,...}}) and persistent listeners export sessionMode='persistent'. QuickJS is embedded in the map library. Applications own UI and connections.

// In an external Transport message loop, await delivery before the next frame.
response.frame(messageBytes).get();
// End this request when the connection closes or fails.
response.failure("IO_ERROR", "Socket closed").get();

Do not await Futures on the map Owner thread inside Transport.start; establish an asynchronous task and return its cancellation handle. frame accepts WebSocket requests only; ordinary HTTP uses success. Input is copied before returning. Each responder permits one in-flight delivery; copied pending responses share a64MiB budget and each frame obeys native maxBytes. Overflow rejects without changing the source. Awaiting completion provides backpressure. cancel must close the application's connection promptly and return.

Pause/re-run/destruction cancel old tasks. One generation accepts successive snapshot/delta frames; stale responses are ignored. failure ends and cancels the external Task. Delivery after host closure rejects. The core owns live protocol,128-bit sequences,pause/resume and reconnection state.

Default WS/WSS is connected in04.8c6; see the default receiver. Custom Transport remains available for additional protocol/authentication needs. This phase completes the Java/JNI response boundary; it does not treat a simulated Transport as an actual socket or phone test. API24/ARM64JNI compilation and20 LinuxJVM real-core/event/pixel checks passed. Android devices,iOS and mobileGIS remain pending.

Android host · Live sources · Acceptance

Terminal errors bypass message backpressure, cancel the external task and discard uncommitted frames. Invalid error arguments preserve the existing channel.