-
Notifications
You must be signed in to change notification settings - Fork 929
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
Improve request/response documentation #5276
Comments
Hi Nazar, thanks for opening this. |
Those are my assumptions, I'm not sure they are 100% accurate.
Absolutely, but there are two implementations already, so maybe more are welcome? |
I'd prefer leaving third party implementations on separate repos where it's maintainers could update them without me having to review them, but I'd be more than happy to update the |
Makes sense to me |
Request/response is a powerful primitive, but could use a better description regarding codec requirements.
I looked at example
json
andcbor
implementations and looks like codec is single-use (I guess a new stream is used for each request/response).Then I looked into why codec is required to be clonable assuming it can be reused for different streams, but turns out it is cloned every time, limiting reuse of previously allocated buffers (that both
json
andcbor
allocated in read methods every time from scratch.Would be great if someone with good knowledge of this protocol improved documentation about codec requirements and maybe improved reviewed code looking at efficiency improvements.
For now I'll just follow mentioned codecs as examples.
P.S. Would be great to see https://github.com/paritytech/parity-scale-codec support as well, I'm happy to send a PR if it is welcome.
The text was updated successfully, but these errors were encountered: