Closed MihaMarkic closed 1 month ago
Thanks for flagging this! I'd go a step further, let's make it pure sync once we have the async overrides, and mark it as obsolete to see what kind of feedback we get. Thoughts @andrueastman ?
Even better, IMO
No objections from my side. The functions are already not async
so making them purely sync is what we should do here really.
Deserialization is taken care with #225
Thanks for the update. I guess at this point the only missing part would be to change that to the sync overload. https://github.com/microsoft/kiota-abstractions-dotnet/blob/56efcdf4227baef8ee75adc342f06e23e96ab3fb/src/serialization/KiotaSerializer.Serialization.cs#L104
Would you mind sending one last PR our way to wrap this aspect up?
@baywet Sure, created. Do you need also version bump?
Getting synchronously results from async functions is quite an issue and should be avoided. Specially in a UI thread environments as described in Stephen's blog post. Sample code in
KiotaSerializer.GetStreamFromString
method:I guess once async overloads are added (#223), this code could be made pure sync and when async is required, a dedicated function can be used instead. Albeit it might cause breaking changes.