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
Add OCF decoder hook #104
Add OCF decoder hook #104
Conversation
Pull Request Test Coverage Report for Build 616
💛 - Coveralls |
src/avro_ocf.erl
Outdated
@@ -177,6 +195,11 @@ make_block(Header, Objects) -> | |||
, Header#header.sync | |||
]. | |||
|
|||
-spec make_decoder_opts(codec_opts()) -> decoder_opts(). | |||
make_decoder_opts(Options) -> | |||
DefaultOptions = [{hook, ?DEFAULT_DECODER_HOOK}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe create a map here, and use maps:merger/2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think for now it should be simplified and not copy-pasted as I did, will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed proplist
to map
also in the spectype
hmm. if we change
we should be able to pass |
Yes, I thought about the number of options for OCF being too small in comparison to Thanks for the suggestion and let me try it! |
@zmstone I adjust the code and in addition, I expand typespec of |
src/avro_ocf.erl
Outdated
-spec decode_blocks(lkup(), avro_type(), avro_codec(), | ||
binary(), binary(), [avro:out()]) -> [avro:out()]. | ||
decode_blocks(_Lkup, _Type, _Codec, _Sync, <<>>, Acc) -> | ||
binary(), binary(), [avro:out()], decoder_options()) -> [avro:out()]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is too long.
@zmstone All the pointed suggestions/issues were applied |
The end result looks pretty good, but it's a lot of back and forth in the commits, which I'd rather avoid. Care to squash to a single commit? |
@mikpe Sure, I can make a single commit, no problem UPD: squash done 📦 |
* Add new public function avro_ocf:decode_binary/2 * Add new public function avro_ocf:decode_file/2 * Extend function interface for avro_binary_decoder:decode_stream/4
469312a
to
a716c41
Compare
@mikpe Hola 👋🏼 Can I ask when do you plan to release the next version with these changes? |
@Strech I can push a new tag tomorrow. |
@mikpe Awesome! Thanks ❤️ |
Updated changelog and tagged 2.9.3. |
@mikpe Thanks a lot 🤝 🎉 |
@mikpe Sorry for the disruption, but I've noticed that the latest version on a https://hex.pm is |
2.9.3 should be on hex now. |
@mikpe Thanks again, much appreciated! 🚀 |
Closes #103
I still have some concerns about how I extend existing internal interfaces for OCF (I've added
hook
to the end of the existing list of arguments), so I'm very open to hear an opinion and adjust the code