19 ms·
> it should be possible to implement functions that can be called in both sync and async contexts, removing the need for function coloring. It is possible! Th
by mrkeen 3y ago
> it should be possible to implement functions that can be called in both sync and async contexts, removing the need for function coloring.
It is possible! They're called blue (sync) functions.
- bheadmaster 3y agoSync functions that block (e.g. perform a system call) cannot be called from async functions. (Actually, they can, but you're going to stop the whole scheduler, or at least one of its worker threads, which is something you really don't want to do...)