-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Implementing __hash__
and __eq__
for BatchedSend
#4273
Comments
Alternatively we might investigate another way to write this code so it doesn't rely on |
Maybe another way to look at this is, when would a cc @mrocklin (in case you have thoughts here 😉) |
It seems reasonable that there would be only one BatchedSend per Client. In this situation I would try implementing this (hopefully it's cheap to do), and then seeing if any tests fail. If no tests fail then we're good to go. |
We can also ask @jrbourbeau to do this if y'all are less familiar here. James is fairly adept at these sorts of changes. |
Found a good way to do this with a |
In
Scheduler.report
we collect aset
ofcomms
for theClient
s. Looking more closely at the contents ofself.client_comms
, it appears to just containBatchedSend
objects. Putting these objects in aset
will wind up using__eq__
and__hash__
. Neither of these appear to be defined byBatchedSend
. As a result a good chunk of time is spent hashing these objects by some fallback mechanism before adding them to theset
inScheduler.report
. Would be good to have implementations of__eq__
and__hash__
forBatchedSend
to avoid this issue.The text was updated successfully, but these errors were encountered: