zbus-old
zbus-old copied to clipboard
Support for awaitable connection
In GitLab by @peelz on Jan 30, 2023, 19:40
It would be nice if connection errors could be reported to the caller by awaiting on the connection, e.g:
let connection = Connection::session().await?;
if let Err(err) = connection.await {
error!("Something bad happened: {err}");
}
I wonder if there is anything other than an error this Future impl can return. If it can only resolve to an error, that's what the output should be and not a Result.
In GitLab by @peelz on Jan 31, 2023, 02:11
It should probably return a Result<(), ...> in case the connection were to close gracefully (see #309).
hmm.. yeah if we go for #309, then definitely.