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
Use thimble #11
Use thimble #11
Conversation
Some points that I hope @manishtomar can answer :)
|
I was mainly trying to replicate same design of
Not really. The other way (as per kazoo lib) of using is to create the objects manually with
Since it has mapping of listeners that can get corrupted when called from multiple threads. In general txkazoo apis are expected to be used in reactor thread only. This is why it has internal mapping of listeners to replay callback in reactor thread. |
Sure, that makes sense :)
Right; but I thought you said at some point that the only way we actually intend to use it is through a client? I could just keep the classes, but since their signature has to change (previously it didn't take a thread pool), it doesn't do much good.
Hm; I thought Thanks for all the comments :) |
Re: Lock and SetPartitioner being externally visible classes, to clarify: I understand why you did that, I'm asking if it's okay if they no longer are :) (Even if they are, they'd probably get turned into functions with a different signature.) |
I think its fine if they are not there. Especially since they'll also have the take reactor and thread pool. And thanks a lot for working on this :) |
It's a bit unfortunate that |
I think this is ready for review. |
def get_async(self, path, watch=None): | ||
"""See py:func:`kazoo.client.KazooClient.get_async`.""" | ||
return self._watch_func(self.client.get_async, path, watch) | ||
def TxKazooClient(reactor, pool, client): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the interface. That should be fine right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Since the old interface didn't take an explicit pool (and instead just messed with the reactor pool), if we use the reactor pool too, we can't see if the txkazoo issues we're seeing right now are somehow related to using the reactor pool. (I don't think that's a credible cause, but it's one of the few this experiment may tell us about.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstrings will be nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 850ecd1
This is great! It will be nice to have some tests for |
Thanks for the review @manishtomar ! Pushed the commits addressing the review comments :) |
Oops, missed that thing about iteration. Fixed that too. I explicitly tested behavior (i.e. that you actually get the underlying |
LGTM! |
WIP, with some review points so it doesn't get too off-track.