24#include "xtc_export.h"
35typedef struct xtc_chan_oneshot xtc_chan_oneshot_t;
44XTC_API
int xtc_chan_oneshot_create(
xtc_res_t *res, xtc_chan_oneshot_t **out);
45XTC_API
void xtc_chan_oneshot_destroy(xtc_chan_oneshot_t *c);
52XTC_API
int xtc_chan_oneshot_send(xtc_chan_oneshot_t *c,
void *msg);
55XTC_API
int xtc_chan_oneshot_try_recv(xtc_chan_oneshot_t *c,
void **out);
62XTC_API
int xtc_chan_oneshot_set_waker(xtc_chan_oneshot_t *c,
const xtc_waker_t *w);
66typedef struct xtc_chan_mpsc xtc_chan_mpsc_t;
77XTC_API
int xtc_chan_mpsc_create(
xtc_res_t *res,
size_t capacity,
78 xtc_chan_mpsc_t **out);
79XTC_API
void xtc_chan_mpsc_destroy(xtc_chan_mpsc_t *c);
90XTC_API
int xtc_chan_mpsc_try_send(xtc_chan_mpsc_t *c,
void *msg);
93XTC_API
int xtc_chan_mpsc_try_recv(xtc_chan_mpsc_t *c,
void **out);
96XTC_API
int xtc_chan_mpsc_set_waker(xtc_chan_mpsc_t *c,
const xtc_waker_t *w);
102XTC_API
int xtc_chan_mpsc_close(xtc_chan_mpsc_t *c);
104XTC_API
size_t xtc_chan_mpsc_len(
const xtc_chan_mpsc_t *c);
108typedef struct xtc_chan_watch xtc_chan_watch_t;
116XTC_API
int xtc_chan_watch_create(
xtc_res_t *res, xtc_chan_watch_t **out);
117XTC_API
void xtc_chan_watch_destroy(xtc_chan_watch_t *c);
118XTC_API
int xtc_chan_watch_send(xtc_chan_watch_t *c,
void *value);
119XTC_API
int xtc_chan_watch_recv(xtc_chan_watch_t *c,
void **out);
123typedef struct xtc_chan_mpmc xtc_chan_mpmc_t;
139XTC_API
int xtc_chan_mpmc_create(
xtc_res_t *res,
size_t capacity,
140 xtc_chan_mpmc_t **out);
141XTC_API
void xtc_chan_mpmc_destroy(xtc_chan_mpmc_t *c);
142XTC_API
int xtc_chan_mpmc_try_send(xtc_chan_mpmc_t *c,
void *msg);
143XTC_API
int xtc_chan_mpmc_try_recv(xtc_chan_mpmc_t *c,
void **out);
144XTC_API
int xtc_chan_mpmc_close(xtc_chan_mpmc_t *c);
145XTC_API
size_t xtc_chan_mpmc_len(
const xtc_chan_mpmc_t *c);
149typedef struct xtc_chan_broadcast xtc_chan_broadcast_t;
150typedef struct xtc_chan_broadcast_recv xtc_chan_broadcast_recv_t;
170XTC_API
int xtc_chan_broadcast_create(
xtc_res_t *res,
size_t capacity,
171 xtc_chan_broadcast_t **out);
172XTC_API
void xtc_chan_broadcast_destroy(xtc_chan_broadcast_t *c);
173XTC_API
int xtc_chan_broadcast_send(xtc_chan_broadcast_t *c,
void *msg);
174XTC_API
int xtc_chan_broadcast_subscribe(xtc_chan_broadcast_t *c,
175 xtc_chan_broadcast_recv_t **out_recv);
176XTC_API
void xtc_chan_broadcast_unsubscribe(xtc_chan_broadcast_recv_t *r);
184XTC_API
int xtc_chan_broadcast_recv(xtc_chan_broadcast_recv_t *r,
185 void **out,
int *lagged);
189typedef struct xtc_chan_demand xtc_chan_demand_t;
217XTC_API
int xtc_chan_demand_create(
xtc_res_t *res,
size_t capacity,
218 xtc_chan_demand_t **out);
219XTC_API
void xtc_chan_demand_destroy(xtc_chan_demand_t *c);
222XTC_API
int xtc_chan_demand_ask(xtc_chan_demand_t *c,
size_t n);
226XTC_API
int xtc_chan_demand_send(xtc_chan_demand_t *c,
void *msg);
229XTC_API
int xtc_chan_demand_try_recv(xtc_chan_demand_t *c,
void **out);
232XTC_API
size_t xtc_chan_demand_outstanding(
const xtc_chan_demand_t *c);
235XTC_API
size_t xtc_chan_demand_len(
const xtc_chan_demand_t *c);
238XTC_API
int xtc_chan_demand_set_producer_waker(xtc_chan_demand_t *c,
242XTC_API
int xtc_chan_demand_set_consumer_waker(xtc_chan_demand_t *c,
246XTC_API
int xtc_chan_demand_close(xtc_chan_demand_t *c);