|
Apache HTTPD
|
Go to the source code of this file.
Typedefs | |
| typedef struct h2_workers | h2_workers |
| typedef struct ap_conn_producer_t | ap_conn_producer_t |
| typedef conn_rec * | ap_conn_producer_next(void *baton, int *pmore) |
| typedef void | ap_conn_producer_done(void *baton, conn_rec *conn) |
| typedef void | ap_conn_producer_shutdown(void *baton, int graceful) |
Functions | |
| 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) |
Tell the producer that processing the connection is done.
| baton | value from producer registration |
| conn | the connection that has been processed. |
Definition at line 87 of file h2_workers.h.
Ask a producer for the next connection to process.
| baton | value from producer registration |
| pconn | holds the connection to process on return |
| pmore | if the producer has more connections that may be retrieved |
Definition at line 80 of file h2_workers.h.
Tell the producer that the workers are shutting down.
| baton | value from producer registration |
| graceful | != 0 iff shutdown is graceful |
Definition at line 94 of file h2_workers.h.
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.
Definition at line 70 of file h2_workers.h.
Definition at line 31 of file h2_workers.h.
| apr_status_t h2_workers_activate | ( | h2_workers * | workers, |
| ap_conn_producer_t * | producer | ||
| ) |
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.
Definition at line 611 of file h2_workers.c.
| h2_workers * h2_workers_create | ( | server_rec * | s, |
| apr_pool_t * | pool, | ||
| int | max_slots, | ||
| int | min_active, | ||
| apr_time_t | idle_limit | ||
| ) |
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
| 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 |
Definition at line 422 of file h2_workers.c.
| apr_uint32_t h2_workers_get_max_workers | ( | h2_workers * | workers | ) |
Get the maximum number of workers.
Definition at line 538 of file h2_workers.c.
| apr_status_t h2_workers_join | ( | h2_workers * | workers, |
| ap_conn_producer_t * | producer | ||
| ) |
Stop retrieving more connection from the producer and wait for all ongoing for from that producer to be done.
Definition at line 589 of file h2_workers.c.
| 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 | ||
| ) |
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().
| 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 |
Definition at line 563 of file h2_workers.c.
| void h2_workers_shutdown | ( | h2_workers * | workers, |
| int | graceful | ||
| ) |
Shut down processing.
Definition at line 543 of file h2_workers.c.