Skip to content
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

[Merged by Bors] - feat: generic implementation of tokio_util::codec::Encoder for FluvioEncoder #1081

Closed
wants to merge 4 commits into from

Conversation

morenol
Copy link
Contributor

@morenol morenol commented May 13, 2021

Fixes #1075

  • Changes the implementation of ResponseMessage and RequestMessage encoder to not include their lengths so the encode-decoder is symmetric now.

  • Added to FluvioCodec the capability to handle FluvioEncoder types.

  • Add implementations of FluvioEncoder to &T: FluvioEncoder.

@morenol morenol force-pushed the lmm/fluviocodec branch 2 times, most recently from 0c669ab to 83020e4 Compare May 13, 2021 12:29
@morenol morenol changed the title [WIP] feat: generic implementation of tokio_util::codec::Encoder for FluvioEncoder feat: generic implementation of tokio_util::codec::Encoder for FluvioEncoder May 13, 2021
@morenol morenol marked this pull request as ready for review May 13, 2021 12:41
@nicholastmosher nicholastmosher requested a review from sehz May 13, 2021 14:13
@sehz
Copy link
Contributor

sehz commented May 13, 2021

@morenol is this ready for review then?

@morenol
Copy link
Contributor Author

morenol commented May 13, 2021

@morenol is this ready for review then?

@sehz Yes, I only have a couple of questions in my comments but I think that it is ready for review

Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! Few changes requires.
Also, should update bump up creates version for codec, add to changelog

src/protocol/fluvio-protocol-codec/src/codec.rs Outdated Show resolved Hide resolved
src/protocol/fluvio-protocol-codec/src/codec.rs Outdated Show resolved Hide resolved
src/protocol/fluvio-protocol-core/src/encoder.rs Outdated Show resolved Hide resolved
src/protocol/fluvio-protocol-core/src/encoder.rs Outdated Show resolved Hide resolved
src/socket/src/sink.rs Outdated Show resolved Hide resolved
@sehz
Copy link
Contributor

sehz commented May 13, 2021

@simlay Can you test if your websocket works with this? You should be able to remove work around for 4 bytes issue

src/socket/src/sink.rs Outdated Show resolved Hide resolved
@morenol morenol force-pushed the lmm/fluviocodec branch 8 times, most recently from 0ad49ba to 62d78e0 Compare May 13, 2021 21:27
@morenol morenol requested a review from sehz May 13, 2021 21:31
@sehz
Copy link
Contributor

sehz commented May 13, 2021

This looks great! @simlay This is ready. Can you test your websocket changes with this?

However, there is problem with codec's version change since it is exported by wrapper crate. There are 2 ways we can solve this:

  1. Keep old version of FluvioCodec until it is deprecated.
  2. Use similar trick here: https://github.com/dtolnay/semver-trick.

@sehz
Copy link
Contributor

sehz commented May 13, 2021

Nice! In that case, you don't have to bump up major version for codec. Just change to 0.3.1

src/socket/src/sink.rs Outdated Show resolved Hide resolved
@sehz
Copy link
Contributor

sehz commented May 14, 2021

can you rebase from master to changes by @simlay ?

…ric FluvioEncoder instead of raw bytes.

feat: make encoder-decoder of RequestMessage and ResponseMessage symmetric

feat: change decode_from_file implementation of ApiMessage to ignore
data lenght since it is not present in the encoding.

test: added test for the cases where it is being used tokio_util::codec::Encoder<T: FluvioEncoder>

build: bump fluvio-protocol-api
@sehz
Copy link
Contributor

sehz commented May 14, 2021

@simlay can you try now?

src/protocol/Cargo.toml Show resolved Hide resolved
src/socket/src/sink.rs Show resolved Hide resolved
@sehz
Copy link
Contributor

sehz commented May 14, 2021

go thru all users of fluvio-protocol and fluvio-socket to ensure they are using latest version

Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Excellent work

@sehz
Copy link
Contributor

sehz commented May 14, 2021

bors r+

bors bot pushed a commit that referenced this pull request May 14, 2021
…Encoder (#1081)

Fixes #1075

* Changes the implementation of ResponseMessage and RequestMessage encoder to not include their lengths so the encode-decoder is symmetric now.
* 
* Added to `FluvioCodec` the capability to handle `FluvioEncoder` types. 

* Add implementations of FluvioEncoder to &T: FluvioEncoder.
@bors bors bot changed the title feat: generic implementation of tokio_util::codec::Encoder for FluvioEncoder [Merged by Bors] - feat: generic implementation of tokio_util::codec::Encoder for FluvioEncoder May 14, 2021
@bors bors bot closed this May 14, 2021
@morenol morenol deleted the lmm/fluviocodec branch May 14, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApiVersion response starts with 4 extra bytes
3 participants