androidx.xr.runtime.java


Top-level functions summary

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

Converts a coroutine created within the session to a ListenableFuture.

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

Converts a flow created within the session to an Observable.

Top-level functions

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

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 Any> toObservable(session: Session, flow: Flow): Observable

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

the Flow to convert to an Observable.