await Portal Response
suspend fun <T> awaitPortalResponse(connection: DBusConnection, methodName: String, call: () -> DBusPath, parseSuccess: (Map<String, Variant<*>>) -> T): Result<T>(source)
Awaits a portal response signal after making a D-Bus request.
This utility encapsulates the common pattern of:
Setting up a signal handler for Request.Response
Making the D-Bus call
Waiting for the response signal
Parsing the result or returning a failure
Return
Result.success with the parsed result, or Result.failure on error or cancellation.
Parameters
connection
The D-Bus connection to use for signal handling.
method Name
The name of the portal method being called (for error messages).
call
A lambda that makes the D-Bus call and returns the request handle path.
parse Success
A lambda that parses the signal results on success.
Type Parameters
T
The type of the successful result.