Replies: 1 comment 1 reply
-
I think you're looking for https://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/fiber_concurrency_rb.html |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In async Ruby, it's desirable to be able to use multiple connections in the same thread, for example:
This will take at least 2 seconds, because Sequel wants to execute both statements using the same connection. It may also cause race conditions because all fibers on the same thread will immediately obtain the "owned" connection and their execution & queries will be interleaved.
This scenario takes less than 2 seconds, because the queries get spread over separate connections, but this obviously isn't the intended use case for multiple servers.
I believe a configuration switch to disable the thread-local lookups would allow the same thread to utilize multiple connections -
sequel/lib/sequel/connection_pool/threaded.rb
Lines 87 to 89 in 7a70ac6
Beta Was this translation helpful? Give feedback.
All reactions