Skip to content

BeginDeserialize/EndDeserialize #15

@llint

Description

@llint

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions