Register functions to be called after a timeout period expires.
More...
Register functions to be called after a timeout period expires.
◆ DPS_DelayedFunc
| typedef void(* DPS_DelayedFunc) (DPS_Node *node, void *data) |
Prototype for a delayed dispatched function call.
This function will be called on the main (internal) node thread and must not block. The dispatcher is internal and not exposed in this usage.
- Parameters
-
| node | The node used for this dispatcher |
| data | The data passed to the DPS_CallDelayedFunc() call |
◆ DPS_DispatchFunc
Prototype for function to be called by a dispatcher.
This function will be called on the main (internal) node thread and must not block.
- Parameters
-
| node | The node used for this dispatcher |
| dispatcher | The dispatcher for this call |
| data | The data passed to the DPS_Dispatch() call |
◆ DPS_CreateDispatcher()
Create a dispatcher and register the function to be called.
- Parameters
-
| node | The node to be used for this dispatcher |
| func | The function to be called |
- Returns
- The created dispatcher, or NULL if creation failed
◆ DPS_DestroyDispatcher()
Destroy a dispatcher and free resources.
- Parameters
-
| dispatcher | The dispatcher to destroy |
◆ DPS_Dispatch()
Call the function registered when the dispatcher was created.
- Parameters
-
| dispatcher | The dispatcher to call |
| data | Data to be passed to the function |
| delay | Time delay in millseconds before the function will be called |
- Returns
- DPS_OK if the function call is scheduled
- DPS_ERR_BUSY if the dispatcher cannot schedule the function
- Or an error status code in which case the callback will not be called.
◆ DPS_ScheduleCall()
Wrapper function that creates a dispatcher and schedules a function to be called after a delay.
The dispatcher is destroyed after the function has been called.
- Parameters
-
| node | The node to be used for the internal dispatcher |
| func | The function to be called |
| data | Data to be passed to the function |
| delay | Time delay in millseconds before the function will be called |
- Returns
- DPS_OK if the function call is scheduled
- DPS_ERR_BUSY if the dispatcher cannot schedule the function
- Or an error status code in which case the callback will not be called.