Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Support for awaitable connection #317

Open
zeenix opened this issue Jan 30, 2023 · 3 comments
Open

Support for awaitable connection #317

zeenix opened this issue Jan 30, 2023 · 3 comments
Labels
enhancement New feature or request zbus Issues/PRs related to zbus crate

Comments

@zeenix
Copy link
Collaborator

zeenix commented Jan 30, 2023

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}");
}
@zeenix
Copy link
Collaborator Author

zeenix commented Jan 30, 2023

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.

@zeenix
Copy link
Collaborator Author

zeenix commented Jan 31, 2023

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).

@zeenix
Copy link
Collaborator Author

zeenix commented Jan 31, 2023

hmm.. yeah if we go for #309, then definitely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request zbus Issues/PRs related to zbus crate
Projects
None yet
Development

No branches or pull requests

1 participant