Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a1744264 authored by Rahul Arya's avatar Rahul Arya Committed by Charlie Boutier
Browse files

[Pandora] Utilities for bidirectional streaming APIs

The OnPair interface (as well as potential others in the future) are
bidirectional streaming rpcs. This CL adds a utility in Kotlin to
emulate the native-Kotlin gRPC interface on top of the Java interface
provided (Flow -> Flow rather than callback-based).

In Python, the native interface consumes an iterator and supplies a new
one. So to interleave rx and tx messages, we need multiple threads. This
CL also adds a client-side utility to simplify usage, by making it mimic
channels (which are the grpc.aio interface, as well as what Go gRPC
does). It means we consume one thread for every active streaming gRPC
call, but this is unavoidable unless we use asyncio channels, which
would require replacing all the mmi2grpc calls with async calls.

Bug: 242326310
Test: next CL
Tag: #feature
Ignore-AOSP-First: Cherry-picked from AOSP
Merged-In: I526982d3163120689797919382a7dff8ff33378f
Change-Id: I526982d3163120689797919382a7dff8ff33378f
parent 3eae7f9e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment