Go to the source code of this file.
◆ dispatcher_create()
Create a dispatcher instance.
- Parameters
-
| bounded_q | The working queue. |
| hashmap | The event map. |
| trafilo_config | The user set config, includes the user set callback functions and the desired number of workers. |
- Returns
- Pointer to dispatcher_t, NULL on creation failure.
◆ dispatcher_destroy()
Free the dispatcher and free memory.
- Parameters
-
| dispatcher | The dispatcher to be destroyed. |
◆ dispatcher_start()
Start a dispatcher thread pool.
- Parameters
-
| dispatcher | The dispatcher to be started. |
- Returns
- 0 on success, -1 on empty dispatcher, -2 if already started.
◆ dispatcher_stop()
Stop a running dispatcher. Wakes all listeners and producers, shutdowns working queue, and drains fields, merge all dispatcher threads. Sets started flag to 0.
- Parameters
-
| dispatcher | The dispatcher to be stopped. |