mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
IpcMain : add support for async callbacks #471
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @duncanawoods on GitHub (Mar 31, 2020).
Originally assigned to: @GregorBiswanger on GitHub.
Callbacks triggered by the UI are async (with respect to the web UI) but are handled with a non-async C# action:
It is now common for C# controller methods to be async so it would be convenient to support them directly with the following overload i.e.
Bridging the sync -> async boundary, might just mean using
Task.Runbut I don't know whether running it on the threadpool is actually optimal because I assumeOnis already being invoked on it's own thread. By implementing this API, hopefully you are able to make the right choice about how to execute the async method without adding unnecessary overhead.