-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Make git::Connection so versatile that it can fit more use-cases #112
Comments
Progress
All the changes above should make it possible to use the standard Looking forward to your feedback. |
This all looks good, will give it a spin shortly!
I'm not sure what you mean by "close" -- there isn't currently much choice but to pass the |
I would expect the connection to be closed on drop as well, right now it's explicitly something that the implementation can and should do when the delegate demands it to be closed, also resulting in the whole operation to stop. There is no other reason for that than me trying to be explicit. Now that I have this borrowchecker issue, again, that prevents me from calling this method maybe that's the hint to remove the Once Let me see what I can do to improve that. |
Great news: This made obvious that |
Transport::close() was actually a misnomer
Are you sure though that the inner writer doesn't need to be flushed?
|
A valid point! Previously flushing wasn't done consistently which didn't change. On the bright side, the underlying implementation is always driven by a packet line writer which could be taught to flush on drop for good measure. My intuition is to wait-and-see if that's necessary, thus far things seemed to have worked as expected, and extra flush calls aren't free. However, it might not be me having to hunt down some weird flush related bug so I would also be OK to simply not take the risk and add a drop impl there. What's your thoughts? |
Relying on |
True that! I will be most grateful for learning from your experience while you are making it, For now it seems to work, but if anything starts getting fishy I will make all efforts to put flushes in the right place, here maybe for blocking. |
Discussed in #110
Originally posted by kim June 25, 2021
It turns out that I needed to define my own
Transport
impl, because:to_url
andis_stateful
methods are used, but morally they need to return different things than the defaultConnection
for my caseTo do that, I needed to make the capabilities parsing public. While that is probably always needed for custom transports, I’m wondering if the interface could be generalised such that more use cases can just reuse a parametric
Connection
. For example, the delegate pattern could be employed for the handshake, and extra parameters could be stored inConnection
.I’d be happy to propose a patch, but wanted to gauge first if there’s interest, or maybe different plans already.
The text was updated successfully, but these errors were encountered: