rethinkdb / rethinkdb-rs

A native RethinkDB driver written in Rust
Apache License 2.0
210 stars 27 forks source link

Concurrent connections #66

Open AadamZ5 opened 2 years ago

AadamZ5 commented 2 years ago

I'm trying to understand how to use RethinkDB in rust. I'm using RethinkDB to power a GraphQL endpoint (using juniper). Static single document queries seem to not be an issue, but when using Subscriptions in GraphQL (which are commonly WebSocket streams streaming change feeds to the client) I have trouble satisfying more than 1 client. I get driver errors like Driver(ConnectionLocked) and "client error; another query is running a changefeed on this connection". How can I facilitate multiple change feeds?

Currently, I'm trying to open a new session (to the same endpoint) for every client that connects, just to see if that would fix the issue. But this still isn't working correctly. Is it possible to open multiple change feeds on the same session, or do I need to make a new session for every change feed? Is this a limitation of the Rust driver, or RethinkDB itself?