-
Notifications
You must be signed in to change notification settings - Fork 82
Allow multiplexed protocols to use different ID types #129
Comments
Definitely possible... It would be worth taking a look to see how much of a headache it would be to make RequestId generic. It would most likely need to have some sort of trait bound to enable the client to generate new request IDs. |
Thinking about generating the IDs, I believe an iterator could be quite close to that. It would be OK, I'm going to add this to the (already not so short) list of things I want to try to write O:-). |
An iterator would probably be best. I guess there should be a I'm hoping that this won't complicate the generics too much.. |
I've created a PR for making
I decided not to go with the iterator but instead added ability to inspect the message, as I have a use case where it might be beneficial to allow user of my library to select the Please have a look at the PR when you have a chance. |
One other concern (I've also been looking at IMAP) is that I think some messages in IMAP are server-initiated; they would effectively not have a |
I am actually facing a similar issue at the moment as this. In my case the messages go:
If I understood the IMAP IDLE and NOTIFY RFC's correctly it'd seem I can't really see how either of these protocols could fit into the current API, or how to implement a specialized version for either. |
@koivunej are you working on a tokio-based IMAP project? Or is this about your eventstore project? My idea so far is that for IMAP, I'd probably have to implement a custom |
@djc I'm interested in for eventstore-tcp, just took a look at the IMAP RFCs in interest of this issue and finding common ground.
This is almost exactly what I've been sketching past days but... My rust-fu is only at the level of hardly making use of tokio, nowhere near actually designing useful APIs :) I'd like to try to help out if I can so feel free to ping me on this topic. |
@koivunej so I looked over your #148, and independently was also wondering why your |
Sure, I'll try but I didn't really spare much thought for this one but focused on getting the code compile and hopefully getting some comments on it. The pre-#148 code does not have any handling for integer overflows with the The first problem with changing the generation part to
How would this work with |
Sorry for the delay. As a result of the Tokio RFC, tokio-proto is going to be significantly simplified. As such, a generic RequestId is out of scope. I'm going close this issue. |
Some protocols use arbitrary or otherwise non-numeric strings as command IDs. An example could be IMAP, which allows anything alphanumeric (https://tools.ietf.org/html/rfc3501#section-2.2.1), or NetConf, which uses an arbitrary string (https://tools.ietf.org/html/rfc6241#section-4.1).
Would it make sense to allow the user of the multiplexed protocol to specify the type for
RequestId
?The text was updated successfully, but these errors were encountered: