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
Currently MsgPack.Deserialize eventually invokes Stream.Read which is blocking. It would be great if there is an asynchronous version BeginDeserialize<T>/EndDeserialize<T> that takes advantage of Stream.BeginRead / Stream.EndRead, so to make the operation asynchronous.
This is good enough for Unity3D (.NET 3.5). For higher version of the runtime (e.g. the experimental .NET 4.6), of course the TAP APIs can be added over the foundational Begin/End async API.
Currently to avoid blocking, I have to create a MemoryStream, asynchronously read (BeginRead/EndRead) from the NetworkStream, and copy the data into the MemoryStream object, and invoke MsgPack.Deserialize on the MemoryStream to make the operation fully asynchronous.
The text was updated successfully, but these errors were encountered:
Hi @llint. Unfortunately I can not add this feature. it will require rewriting every layer of serialization/de-serialization code because stream at lowest layer.
User API (you are interacting with it)
TypeSerializer
Tokenizer
Stream
As I remember even json.NET doesn't support async serialization/de-serialization.
Currently to avoid blocking, I have to create a MemoryStream, asynchronously read (BeginRead/EndRead) from the NetworkStream, and copy the data into the MemoryStream object, and invoke.
Yep, this is only solution for this scenario if you want to avoid blocking.
Currently
MsgPack.Deserialize
eventually invokesStream.Read
which is blocking. It would be great if there is an asynchronous versionBeginDeserialize<T>/EndDeserialize<T>
that takes advantage ofStream.BeginRead
/Stream.EndRead
, so to make the operation asynchronous.This is good enough for Unity3D (.NET 3.5). For higher version of the runtime (e.g. the experimental .NET 4.6), of course the TAP APIs can be added over the foundational Begin/End async API.
Currently to avoid blocking, I have to create a MemoryStream, asynchronously read (
BeginRead
/EndRead
) from theNetworkStream
, and copy the data into theMemoryStream
object, and invokeMsgPack.Deserialize
on theMemoryStream
to make the operation fully asynchronous.The text was updated successfully, but these errors were encountered: