androidx.xr.runtime.java


Top-level functions summary

ListenableFuture<T>
<T : Any?> toFuture(session: Session, coroutine: suspend CoroutineScope.() -> T)

Converts a coroutine created within the session to a ListenableFuture.

Observable<T>
<T : Any> toObservable(session: Session, flow: Flow<T>)

Converts a flow created within the session to an Observable.

Top-level functions

fun <T : Any?> toFuture(session: Session, coroutine: suspend CoroutineScope.() -> T): ListenableFuture<T>

Converts a coroutine created within the session to a ListenableFuture.

The returned ListenableFuture will be automatically cancelled when the session is destroyed.

Parameters
session: Session

the Session that originated the coroutine.

coroutine: suspend CoroutineScope.() -> T

the coroutine to convert to a ListenableFuture.

toObservable

fun <T : Any> toObservable(session: Session, flow: Flow<T>): Observable<T>

Converts a flow created within the session to an Observable.

The returned Observable will be given the session's CoroutineContext.

Parameters
session: Session

the Session that originated the flow.

flow: Flow<T>

the Flow to convert to an Observable.