-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support Task return value serialization #81
Comments
@CableZa and friends, I have a proof-of-concept of serializing a |
Sketch of my plan: to implement type converters that will transform an unserializable type into a serializable representation, before we hit the serializer, and likewise to convert back. interface ITypeConverter
{
/// <summary>
/// Potentially converts an unserializable object to a more serializable form.
/// </summary>
/// <param name="input">An input object.</param>
/// <param name="output">An output object. Will be assigned to a simpler representation of <paramref name="input"/>, if this converter knows how.</param>
/// <returns><c>true</c> if the conversion happened, otherwise <c>false</c>. Good for building a chain of responsibility.</returns>
bool ConvertForSerialization(object? input, out object? output);
/// <summary>
/// Potentially converts the serializable form of an object back to its unserializable form.
/// </summary>
/// <param name="deserializedType">The desired deserialized type.</param>
/// <param name="input">An input object.</param>
/// <param name="output">An output object. Will be reconstituted from it's simpler representation as <paramref name="input"/>, if this converter knows how.</param>
/// <returns><c>true</c> if the conversion happened, otherwise <c>false</c>. Good for building a chain of responsibility.</returns>
bool ConvertForDeserialization(Type deserializedType, object? input, out object? output);
} That'll probably change a bit as I work. My initial plan is to build in a few converters for some framework types, and allow a plugin mechanism for clients to add their own. |
Split from #79, as proposed by @CableZa.
The text was updated successfully, but these errors were encountered: