Udipe 1.0
Solving the riddle of high-throughput UDP
Loading...
Searching...
No Matches
future.h
Go to the documentation of this file.
1#pragma once
2
16
17#include "context.h"
18#include "nodiscard.h"
19#include "pointer.h"
20#include "result.h"
21#include "time.h"
22#include "visibility.h"
23
24#include <assert.h>
25#include <stdbool.h>
26#include <stddef.h>
27#include <stdint.h>
28#include <time.h>
29
30
231typedef struct udipe_future_s udipe_future_t;
232
264//
265// TODO: Implement, should probably start with
266// udipe_wait(future, UDIPE_DURATION_MAX)
267// TODO: Make sure that even if some input futures have been canceled, this
268// function does not return until the pointer-based inputs of the original
269// async operation are known to be safe from any access and can therefore
270// be modified or liberated by the user.
275
331//
332// TODO: Implement
337
402//
403// TODO: Implement
407bool udipe_cancel(udipe_future_t* future, bool finish);
408
452//
453// TODO: Implement.
459 udipe_future_t* const futures[],
460 size_t num_futures);
461
487 udipe_future_t* const futures[],
488 size_t num_futures);
489
555//
556// TODO: Implement.
562 udipe_future_t* const futures[],
563 size_t num_futures);
564
593//
594// TODO: Implement.
600 const struct timespec *ts);
601
642//
643// TODO: Implement.
649 const struct timespec *initial,
650 udipe_duration_ns_t interval);
651
729//
730// TODO: Implement.
736
756//
757// TODO: Implement.
762
788//
789// TODO: Implement.
793
826//
827// TODO: Implement.
831 bool successful,
832 udipe_custom_payload_t payload);
Core libudipe context.
struct udipe_context_s udipe_context_t
Definition context.h:65
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_PUBLIC udipe_result_t udipe_finish(udipe_future_t *future)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_NON_NULL_RESULT UDIPE_PUBLIC udipe_future_t * udipe_start_timer_repeat(udipe_context_t *context, const struct timespec *initial, udipe_duration_ns_t interval)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_NON_NULL_RESULT UDIPE_PUBLIC udipe_future_t * udipe_start_join(udipe_context_t *context, udipe_future_t *const futures[], size_t num_futures)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_PUBLIC bool udipe_cancel(udipe_future_t *future, bool finish)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_PUBLIC bool udipe_custom_cancelled(udipe_future_t *custom)
struct udipe_future_s udipe_future_t
Definition future.h:231
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_NON_NULL_RESULT UDIPE_PUBLIC udipe_future_t * udipe_start_timer_once(udipe_context_t *context, const struct timespec *ts)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_NON_NULL_RESULT UDIPE_PUBLIC udipe_future_t * udipe_start_custom(udipe_context_t *context)
UDIPE_PUBLIC UDIPE_NON_NULL_ARGS void udipe_join(udipe_context_t *context, udipe_future_t *const futures[], size_t num_futures)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_NON_NULL_RESULT UDIPE_PUBLIC udipe_future_t * udipe_start_unordered(udipe_context_t *context, udipe_future_t *const futures[], size_t num_futures)
UDIPE_NON_NULL_ARGS UDIPE_PUBLIC bool udipe_custom_try_set_result(udipe_future_t *custom, bool successful, udipe_custom_payload_t payload)
UDIPE_NODISCARD UDIPE_NON_NULL_ARGS UDIPE_PUBLIC bool udipe_wait(udipe_future_t *future, udipe_duration_ns_t timeout)
UDIPE_NON_NULL_ARGS UDIPE_PUBLIC void udipe_custom_finish_cancel(udipe_future_t *custom)
Nodiscard polyfill.
#define UDIPE_NODISCARD
Definition nodiscard.h:20
Pointer shenanigans.
#define UDIPE_NON_NULL_ARGS
Definition pointer.h:17
#define UDIPE_NON_NULL_RESULT
Definition pointer.h:40
Generic result type.
Definition result.h:49
Definition result.h:186
Time-related definitions.
uint64_t udipe_duration_ns_t
Definition time.h:40
Imported symbol visibility.
#define UDIPE_PUBLIC
Definition visibility.h:37