-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Why does rpc.Transport care about the CapTable? #216
Comments
I am able to confirm that just not clearing cap table in |
@lthibault, I think if we don't hear from @zombiezen in a few days time I'll go ahead with a pr that gets rid of this requirement -- unless you see a reason not to. Curious as to your thoughts on the design. |
This is on my radar but I haven't had time to sit down and page in context. Will try to get back to you soon, but don't mark me as critical dependency. 👍 |
Okay, I remember now. It's a question of ownership/lifetimes: since That said, now I'm curious as to what situation you were in where you were holding onto a cap table on a released or about-to-be-released message. |
The problem really is that the This became a problem when implementing support for Getting rid of |
Thinking about this again, maybe the right semantics is to relax this so that CapTable may be non-nil when sending, but still require it to be nil when releasing, which solves the problem you were trying to address without making things awkward in my scenario. |
We recently merged a patch that clarifies that the transport is supposed to .Release() anything in the cap table when the release func is called, which simplifies some things and happens to be existing behavior. So I'm to say this is settled. Closing. |
I'm hoping @zombiezen can enlighten me on this one:
The
rpc.Transport
interface'sNewMessage
andRecvMessage
methods both document that the caller is allowed to modify the cap table, but that it must be nil when sending or releasing the message. My question is: why? as far as I can tell this isn't actually relied upon by any actual code, except for the parts of the test suite that enforce it by panicking if it is non-nil at the wrong time.This came up as I discovered when debugging #213 that a promise was erroneously being resolved to a nil Client, because this had been cleared for the benefit of send(). I'm staring at how to to rework this to avoid this problem, but I'm also wondering if the right solution is to just relax that requirement and then not clear the table. So I wanted to ask if there was a rationale, because it isn't obvious to me.
The text was updated successfully, but these errors were encountered: