mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Add asynchronous work API to the network manager
The libuv has a support for running long running tasks in the dedicated threadpools, so it doesn't affect networking IO. This commit adds isc_nm_work_enqueue() wrapper that would wraps around the libuv API and runs it on top of associated worker loop. The only limitation is that the function must be called from inside network manager thread, so the call to the function should be wrapped inside a (bound) task.
This commit is contained in:
@@ -646,6 +646,17 @@ typedef union {
|
||||
isc__netievent_tlsconnect_t nitc;
|
||||
} isc__netievent_storage_t;
|
||||
|
||||
/*
|
||||
* Work item for a uv_work threadpool.
|
||||
*/
|
||||
typedef struct isc__nm_work {
|
||||
isc_nm_t *netmgr;
|
||||
uv_work_t req;
|
||||
isc_nm_workcb_t cb;
|
||||
isc_nm_after_workcb_t after_cb;
|
||||
void *data;
|
||||
} isc__nm_work_t;
|
||||
|
||||
/*
|
||||
* Network manager
|
||||
*/
|
||||
|
Reference in New Issue
Block a user