Mazyod / PhoenixSharp

C# Phoenix Channels client. Unity Compatible.
MIT License
162 stars 27 forks source link

Async/await API? #16

Open Shivang44 opened 4 years ago

Shivang44 commented 4 years ago

As I understand it, Unity3d now supports async/await but doesn't create a new thread for the execution.

Still, I believe it makes writing async code really intuitive and easy. The fenix library supports async/await (but doesn't work for me for other reasons) and the API is great.

What are your thoughts on this? Would this be a major code re-haul (I have no experience with C#)? If you want to do this I am willing to help in any way I can.

Mazyod commented 4 years ago

Thanks for raising this. Support of C# 7.0 features have been on the roadmap, but never got around to it.

I am not sure if it would be an overhaul or a simple redundant API for the library that provides async/await flows. My intuition leads me to think it's a simple extra layer on top of the current API to support async/await.

I've wanted to work on it myself, but never had the chance.

Shivang44 commented 4 years ago

Awesome, glad there's interest. If I get time I will look into this myself as well. Very little experience in C# though. Hopefully a wrapper around the current API will be enough.

Mazyod commented 2 years ago

~I'll try to pick this one up during the rewrite #20~. too big of a scope to deal with rn.

Basically, the main problem I'm facing with introducing async APIs is that I don't use them personally, which makes it challenging to conceive of a useful async API (given the lack of use case from my side).