diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/qntan/Qntan.h | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index a79dd6f..aaca3a7 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -101,13 +101,6 @@ struct Qntan_EvLoop { /* * Process reactor tasks until event loop is signalized to end. */ void (*runUntilDone)( struct Qntan_EvLoop** ); -#if 0 -TODO /* -TODO * TODO that should be something like a 'Scheduler' or similar. */ -TODO void (*setTimeoutMs)( -TODO struct Qntan_EvLoop**, struct Garbage_ThreadPool**, int delayMs, -TODO void(*fn)(int eno, Qntan_Cls), Qntan_Cls ); -#endif /* * returns NON-zero, if called from the EvLoopThread. This is intended for * assertions, to check that one is running on the expected thread. */ @@ -187,10 +180,31 @@ struct Qntan_MemArena { struct Qntan_Executor { - /* - * enque a task to this executor. */ - void (*enque)( - struct Qntan_Executor**, void(*fn)(Qntan_Cls), Qntan_Cls ); + void (*enque)( struct Qntan_Executor**, void(*fn)(Qntan_Cls), Qntan_Cls ); + /* enque a task to this executor. How the task gets executed depends on what + * executor instance got chosen. This also includes stuff like ThreadPools + * which may execute stuff out of order. + */ +}; + + + + + + + + + + +struct Qntan_Scheduler { + /**/ + void (*onceAfterMs)( + struct Qntan_Scheduler**, int delayMs, void(*fn)(int eno, Qntan_Cls), Qntan_Cls ); + /* Schedule 'fn' to be called after 'delayMs' milliseconds. + * TODO: Specify if time refers to wall-clock, monotonic, etc. For now this + * behavior is implementation-defined, BUT MAY IT WILL BE SPECIFIED HERE IN + * FUTURE! + */ }; |
