You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second line produces :error because serialized is iodata and deserialize expects a binary.
This is a little bit of a contrived use case, but I imagine there are other cases where one might be feeding iodata into the deserializer?
This raises another question, as well. Should there be a way to handle partial messages? I can imagine cases where a server is listening to a data stream, and due to the way that the data is chunked one may receive a partial message. I imagine the API would look something like updated_object = Mod.deserialize(new_data, partial_object_from_previous_data)
The text was updated successfully, but these errors were encountered:
We skipped it when implementing binary protocol because it's unnecessary for clients/servers using framed transport and it would have complicated the deserialization logic quite a bit. Or at least I didn't see a simple way to do it.
This is nice if the deserializer is decoupled from the server/framing, and the expectation is for the user to implement either or both of those because it allows the user to efficiently receiving the data.
I came across this trying to do something like the following.
The second line produces
:error
becauseserialized
is iodata anddeserialize
expects a binary.This is a little bit of a contrived use case, but I imagine there are other cases where one might be feeding iodata into the deserializer?
This raises another question, as well. Should there be a way to handle partial messages? I can imagine cases where a server is listening to a data stream, and due to the way that the data is chunked one may receive a partial message. I imagine the API would look something like
updated_object = Mod.deserialize(new_data, partial_object_from_previous_data)
The text was updated successfully, but these errors were encountered: