discord-net / Discord.Net

An unofficial .Net wrapper for the Discord API (https://discord.com/)
https://discordnet.dev
MIT License
3.29k stars 743 forks source link

Gateway thread message pump to allow await without blocking #1913

Open Khitiara opened 3 years ago

Khitiara commented 3 years ago

Proposal is for allowing user messages to be injected into the gateway thread message processing queue/loop, which would allow scheduling continuations on the gateway thread without stalling the gateway read. Similar to the message queue/pump used by wpf and winforms among others, and makes thread safety significantly easier without required blocking

budgetdevv commented 2 years ago

Please make this happen. As of today, there isn't a way for long-running cmds to get updated info unless wrapped with Task.Run()