protobuf-net实现的一个限制是它同步调用底层流.通过不提供异步API,例如BeginSerialize/EndSerialize或TPL等价物,我们被迫绑定一个等待同步流I/O的线程.
有没有计划在protobuf-net中提供异步方法,或者有任何创造性的方法来解决这个问题?
所以我有一个xml,它具有与此类似的结构:
<MyObject>
<PropertyA>Value</PropertyA>
<PropertyB>Value</PropertyB>
<PropertyC>Value</PropertyC>
<ArrayOfOtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
</ArrayOfOtherObject>
</MyObject>
Run Code Online (Sandbox Code Playgroud)
有没有办法可以反序列化MyObject而不是ArrayOfOtherObject?然后在需要时做一个懒惰的ArrayOfOtherObject加载?
我通常使用XmlDeserialization,但AFAIK总是加载整个东西.
谢谢!