duplex-mobile

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

duplex-mobile is the iOS and Android self-test of Tango's ipc streams: the duplex examples' services (package examples/duplex/services: Echo, Upload, Sink, Source, Bench.Report) behind an ipc.Router wired like examples/duplex, and a page (services/selftest.js) that exercises them and reports to Go, which logs one line per result.

bash mobile/ios/build.sh examples/duplex-mobile simulator
GOFLAGS=-tags=tango_selftest bash mobile/android/build.sh examples/duplex-mobile

On Android the variables below come from the launch extra TANGO_TEST_ENV (tango_selftest builds, debuggable APK: am start ... --esa TANGO_TEST_ENV TANGO_SCHEME_PROBE=1,TANGO_SCHEME_SELFTEST=1; scripts/smoke.sh android-selftest). The Android lanes (down:android, up:android) are on by default; TANGO_IPC_LANES_ANDROID=0 turns them off.

With TANGO_SCHEME_PROBE=1 (simctl launch: SIMCTL_CHILD_TANGO_SCHEME_PROBE=1) the page opens as index.html?probe and runs the WebKit streaming probe instead: the iOS backend answers /__tango/probe/stream itself with 8 chunks of 1 KiB, 200 ms apart, and the page logs when each one arrived ("probe: {...}"); scripts/smoke.sh ios-probe judges it. TANGO_SCHEME_PROBE=1 also adds the scheme-handler test routes (/__test/..., package examples/duplex/services) and the ipc method Debug.Stats. With TANGO_SCHEME_SELFTEST=1 as well the page opens as index.html?selftest instead and runs the scheme-handler self-test: the request sequence of internal/platform/darwin's TestAsyncSchemeParity, checked against the expected answers, and an aborted never-ending stream whose Go handler must return, and the IPC fast lanes the page got (smoke.sh launches with TANGO_IPC_LANES_DARWIN=1, which turns them on: iOS lanes are off by default; on macOS, where up:post is on by default, the =1 changes nothing) and the lane scenarios of examples/duplex/services/lanetests.js ("selftest: {...}"; scripts/smoke.sh ios-selftest judges it). With TANGO_IPC_LANE_FAULT set too (a tango_dev or tango_selftest build, scripts/smoke.sh ios-lanefault: TANGO_IPC_LANE_FAULT=up:post:3) the page opens as index.html?selftest&lanefault and runs only the lane fault scenario ("lanefault: {...}"). With TANGO_DUPLEX_BENCH=1 the page opens as index.html?bench whatever the other variables say (it is checked first) and runs the duplex benchmark of /bench.js (package examples/duplex/services, the same code as go run ./examples/duplex -bench; "bench: {...}", docs/ipc-bench.md). TANGO_SCHEME_PROBE=1 may be added for Debug.Stats' up:post counters in the result (the benchmark verdict runs in docs/ipc-bench.md were made without it). On iOS and macOS, up:post is on by default and TANGO_IPC_LANES_DARWIN=0 gives the fallback configuration. It also runs on the desktop (go run ./examples/duplex-mobile).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL