-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Update 'Client' to hold stack of connection/batch/transaction objects. #976
Update 'Client' to hold stack of connection/batch/transaction objects. #976
Conversation
|
Objects pushe onto the client's '_connection_stack' must implement the 'Connection' API, but need not be subclasses of 'Connection'. [ci skip]
They must all be implement the "connection" API. I can't think of a better name.
I think so. I threw out a much bigger changeset and started over, but I think this is simpler / clearer. |
But Yeah the thread-safety issue is not resolved by this, can you file an issue so that we follow up? |
self.assertTrue(client.current_batch is None) | ||
self.assertEqual(list(client._batch_stack), []) | ||
|
||
def test__push_connection_and__pop_connection(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM other than small nit. I think the answer to my "is it expensive" question is "no", but maybe you can educate me. |
I have a fix for the test name on the next PR. ISTM that the expense of creating a thread-local object isn't really an issue for our |
…h_stack Update 'Client' to hold stack of connection/batch/transaction objects.
Good call on net zero. |
See #944.