Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
560 stars 94 forks source link

[BUG] Asynchronous calls #122

Closed HeberonYT closed 3 years ago

HeberonYT commented 3 years ago

Hi, I have a query, are the calls running asynchronously? Should I make the calls in a sub process so as not to freeze the application during the request?

Nice work with the API, thanks.

Lachee commented 3 years ago

All the calls are queued to a thread, which sends them to discord in the background. You dont need to worry about sub-processes, since it technically is one already.

Note

Because it's on a separate thread, the events will be called on that thread. You may need to do appropriate safe guarding in your code for thread safety or disable this and manually invoke the events yourself ( under "Invoking" in README.md)

HeberonYT commented 3 years ago

Thanks for the info. If calls are already in the background, then everything is fine for me. Thanks a lot.