Skip to content

Notifications and statements through the same connection #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
grotsev opened this issue Oct 31, 2017 · 1 comment
Closed

Notifications and statements through the same connection #302

grotsev opened this issue Oct 31, 2017 · 1 comment

Comments

@grotsev
Copy link

grotsev commented Oct 31, 2017

connection.notifications().for_each(|n| ... )

consumes connection.

Is there any way to get notifications and execute statements on the same connection? Or I have to open second one.

@sfackler
Copy link
Owner

You can turn the Notifications stream back into a Connection with into_inner, but that's probably not all that easy to work with.

Not sure what a better API would be - it seems like it'd be nice if notifications() took &self so you could work with it and the main connection at the same time, but that'd require a SPMC channel.

@grotsev grotsev closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants