25#include "xtc_export.h"
36typedef struct xtc_chan_oneshot xtc_chan_oneshot_t;
45XTC_API
int xtc_chan_oneshot_create(
xtc_res_t *res, xtc_chan_oneshot_t **out);
46XTC_API
void xtc_chan_oneshot_destroy(xtc_chan_oneshot_t *c);
53XTC_API
int xtc_chan_oneshot_send(xtc_chan_oneshot_t *c,
void *msg);
56XTC_API
int xtc_chan_oneshot_try_recv(xtc_chan_oneshot_t *c,
void **out);
63XTC_API
int xtc_chan_oneshot_set_waker(xtc_chan_oneshot_t *c,
const xtc_waker_t *w);
67typedef struct xtc_chan_mpsc xtc_chan_mpsc_t;
78XTC_API
int xtc_chan_mpsc_create(
xtc_res_t *res,
size_t capacity,
79 xtc_chan_mpsc_t **out);
80XTC_API
void xtc_chan_mpsc_destroy(xtc_chan_mpsc_t *c);
91XTC_API
int xtc_chan_mpsc_try_send(xtc_chan_mpsc_t *c,
void *msg);
97XTC_API
int xtc_chan_mpsc_try_recv(xtc_chan_mpsc_t *c,
void **out);
100XTC_API
int xtc_chan_mpsc_set_waker(xtc_chan_mpsc_t *c,
const xtc_waker_t *w);
106XTC_API
int xtc_chan_mpsc_close(xtc_chan_mpsc_t *c);
108XTC_API
size_t xtc_chan_mpsc_len(
const xtc_chan_mpsc_t *c);
112typedef struct xtc_chan_watch xtc_chan_watch_t;
120XTC_API
int xtc_chan_watch_create(
xtc_res_t *res, xtc_chan_watch_t **out);
121XTC_API
void xtc_chan_watch_destroy(xtc_chan_watch_t *c);
122XTC_API
int xtc_chan_watch_send(xtc_chan_watch_t *c,
void *value);
123XTC_API
int xtc_chan_watch_recv(xtc_chan_watch_t *c,
void **out);
127typedef struct xtc_chan_mpmc xtc_chan_mpmc_t;
143XTC_API
int xtc_chan_mpmc_create(
xtc_res_t *res,
size_t capacity,
144 xtc_chan_mpmc_t **out);
145XTC_API
void xtc_chan_mpmc_destroy(xtc_chan_mpmc_t *c);
146XTC_API
int xtc_chan_mpmc_try_send(xtc_chan_mpmc_t *c,
void *msg);
147XTC_API
int xtc_chan_mpmc_try_recv(xtc_chan_mpmc_t *c,
void **out);
148XTC_API
int xtc_chan_mpmc_close(xtc_chan_mpmc_t *c);
149XTC_API
size_t xtc_chan_mpmc_len(
const xtc_chan_mpmc_t *c);
153typedef struct xtc_chan_broadcast xtc_chan_broadcast_t;
154typedef struct xtc_chan_broadcast_recv xtc_chan_broadcast_recv_t;
174XTC_API
int xtc_chan_broadcast_create(
xtc_res_t *res,
size_t capacity,
175 xtc_chan_broadcast_t **out);
176XTC_API
void xtc_chan_broadcast_destroy(xtc_chan_broadcast_t *c);
177XTC_API
int xtc_chan_broadcast_send(xtc_chan_broadcast_t *c,
void *msg);
178XTC_API
int xtc_chan_broadcast_subscribe(xtc_chan_broadcast_t *c,
179 xtc_chan_broadcast_recv_t **out_recv);
180XTC_API
void xtc_chan_broadcast_unsubscribe(xtc_chan_broadcast_recv_t *r);
188XTC_API
int xtc_chan_broadcast_recv(xtc_chan_broadcast_recv_t *r,
189 void **out,
int *lagged);
193typedef struct xtc_chan_demand xtc_chan_demand_t;
221XTC_API
int xtc_chan_demand_create(
xtc_res_t *res,
size_t capacity,
222 xtc_chan_demand_t **out);
223XTC_API
void xtc_chan_demand_destroy(xtc_chan_demand_t *c);
226XTC_API
int xtc_chan_demand_ask(xtc_chan_demand_t *c,
size_t n);
230XTC_API
int xtc_chan_demand_send(xtc_chan_demand_t *c,
void *msg);
233XTC_API
int xtc_chan_demand_try_recv(xtc_chan_demand_t *c,
void **out);
236XTC_API
size_t xtc_chan_demand_outstanding(
const xtc_chan_demand_t *c);
239XTC_API
size_t xtc_chan_demand_len(
const xtc_chan_demand_t *c);
242XTC_API
int xtc_chan_demand_set_producer_waker(xtc_chan_demand_t *c,
246XTC_API
int xtc_chan_demand_set_consumer_waker(xtc_chan_demand_t *c,
250XTC_API
int xtc_chan_demand_close(xtc_chan_demand_t *c);