ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
worker.h
Go to the documentation of this file.
1#pragma once
2
3#include "udp.h"
4#include <libplatform/mutex.h>
5
6/* Private endpoint worker. Run at most one worker for an endpoint. The endpoint, lane mutex, and callback context
7 * remain owned by the caller and outlive the stopped worker. An accept callback
8 * runs under the lane lock and must not block or call locking adapter methods.
9 * A failure callback runs without that lock and must detach and remove the
10 * failed connection before returning true; false stops the worker. */
13
15 void *context, quic_worker_t **out);
16/* Variant: failure callback runs on the held endpoint lane and must not lock it. */
19/* Thread-safe while the worker and endpoint remain alive. */
20void quic_worker_wake(void *worker);
21/* Stops and joins the worker, then frees it. Returns its terminal error. */
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
struct quic_connection quic_connection_t
static bool size_t gotel_query_t * out
Definition queries.h:8
For acip quic worker, this is the live record that ties endpoint, lane, failure, context together....
Definition worker.c:13
void * context
Definition worker.c:17
quic_worker_failure_fn failure
Definition worker.c:16
mutex_t * lane
Definition worker.c:15
quic_udp_endpoint_t * endpoint
Definition worker.c:14
struct quic_udp_endpoint quic_udp_endpoint_t
Definition udp.h:14
struct quic_worker quic_worker_t
Definition worker.h:11
asciichat_error_t quic_worker_start_locked_failure(quic_udp_endpoint_t *endpoint, mutex_t *lane, quic_worker_failure_fn failure, void *context, quic_worker_t **out)
Definition worker.c:107
asciichat_error_t quic_worker_start(quic_udp_endpoint_t *endpoint, mutex_t *lane, quic_worker_failure_fn failure, void *context, quic_worker_t **out)
Definition worker.c:102
void quic_worker_wake(void *worker)
Definition worker.c:112
asciichat_error_t quic_worker_stop(quic_worker_t **worker)
Definition worker.c:118
bool(* quic_worker_failure_fn)(quic_connection_t *, asciichat_error_t, void *)
Definition worker.h:12