Go to the source code of this file.
|
h2_workers * | h2_workers_create (server_rec *s, apr_pool_t *pool, int max_slots, int min_active, apr_time_t idle_limit) |
|
void | h2_workers_shutdown (h2_workers *workers, int graceful) |
|
apr_uint32_t | h2_workers_get_max_workers (h2_workers *workers) |
|
ap_conn_producer_t * | h2_workers_register (h2_workers *workers, apr_pool_t *producer_pool, const char *name, ap_conn_producer_next *fn_next, ap_conn_producer_done *fn_done, ap_conn_producer_shutdown *fn_shutdown, void *baton) |
|
apr_status_t | h2_workers_join (h2_workers *workers, ap_conn_producer_t *producer) |
|
apr_status_t | h2_workers_activate (h2_workers *workers, ap_conn_producer_t *producer) |
|
◆ ap_conn_producer_done
typedef void ap_conn_producer_done(void *baton, conn_rec *conn) |
Tell the producer that processing the connection is done.
- Parameters
-
baton | value from producer registration |
conn | the connection that has been processed. |
◆ ap_conn_producer_next
typedef conn_rec* ap_conn_producer_next(void *baton, int *pmore) |
Ask a producer for the next connection to process.
- Parameters
-
baton | value from producer registration |
pconn | holds the connection to process on return |
pmore | if the producer has more connections that may be retrieved |
- Returns
- APR_SUCCESS for a connection to process, APR_EAGAIN for no connection being available at the time.
◆ ap_conn_producer_shutdown
typedef void ap_conn_producer_shutdown(void *baton, int graceful) |
Tell the producer that the workers are shutting down.
- Parameters
-
baton | value from producer registration |
graceful | != 0 iff shutdown is graceful |
◆ ap_conn_producer_t
ap_conn_producer_t is the source of connections (conn_rec*) to run.
Active producers are queried by idle workers for connections. If they do not hand one back, they become inactive and are not queried further. h2_workers_activate()
places them on the active list again.
A producer finishing MUST call h2_workers_join()
which removes it completely from workers processing and waits for all ongoing work for this producer to be done.
◆ h2_workers
◆ h2_workers_activate()
Activate a producer. A worker will query the producer for a connection to process, once a worker is available. This may be called, irregardless of the producers active/inactive.
◆ h2_workers_create()
Create a worker set with a maximum number of 'slots', e.g. worker threads to run. Always keep min_active
workers running. Shutdown any additional workers after idle_secs
seconds of doing nothing.
@oaram s the base server
- Parameters
-
pool | for allocations |
min_active | minimum number of workers to run |
max_slots | maximum number of worker slots |
idle_limit | upper duration of idle after a non-minimal slots shuts down |
◆ h2_workers_get_max_workers()
Get the maximum number of workers.
◆ h2_workers_join()
Stop retrieving more connection from the producer and wait for all ongoing for from that producer to be done.
◆ h2_workers_register()
Register a new producer with the given baton
and callback functions. Will allocate internal structures from the given pool (but make no use of the pool after registration). Producers are inactive on registration. See h2_workers_activate()
.
- Parameters
-
producer_pool | to allocate the producer from |
name | descriptive name of the producer, must not be unique |
fn_next | callback for retrieving connections to process |
fn_done | callback for processed connections |
baton | provided value passed on in callbacks |
- Returns
- the producer instance created
◆ h2_workers_shutdown()