You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stream_conversations with callback pulls a new connection from the database multiple times, despite theoretically having the ability to do one of
1.) hold on to one connection for the duration of the stream
2.) pull one connection for all its operations before adding it back to the pool
Here's where we pull connections:
transaction_async pulls a new connection for processing a new welcome
pulls another connection again after the transaction for other operations
DM groups will pull yet another connection when checking for DM groups.
instead, we can create a new transaction function wrapping the existing one transaction_async_with_provider to reuse a provider, and then reuse that connection for the subsequent operations. this should reduce some churn in the Pool upon getting a new welcome/group in the stream
Then require that process_streamed_welcome accept a provider
This will allow us to instantiate a provider at the head of the stream message and use it for all ops
The text was updated successfully, but these errors were encountered:
stream_conversations
with callback pulls a new connection from the database multiple times, despite theoretically having the ability to do one of1.) hold on to one connection for the duration of the stream
2.) pull one connection for all its operations before adding it back to the pool
Here's where we pull connections:
transaction_async
pulls a new connection for processing a new welcomeinstead, we can create a new transaction function wrapping the existing one
transaction_async_with_provider
to reuse a provider, and then reuse that connection for the subsequent operations. this should reduce some churn in the Pool upon getting a new welcome/group in the streamThen require that
process_streamed_welcome
accept a providerThis will allow us to instantiate a provider at the head of the stream message and use it for all ops
The text was updated successfully, but these errors were encountered: