call_asap

Function call_asap 

Source
pub fn call_asap<F: FnOnce() + 'static>(f: F) -> Result<(), MainLoopError>
Expand description

Runs a function as soon as possible, i e, when the main loop runs.

Corresponding platform specific APIs:

  • glib: g_idle_add
  • node.js: process.nextTick
  • web: Promise.resolve().then(…)
  • win32: PostMessage