This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tfe/common/include/tfe_future.h

21 lines
565 B
C
Raw Normal View History

enum e_future_error
{
FUTURE_ERROR_CANCEL,
FUTURE_ERROR_EXCEPTION,
FUTURE_ERROR_TIMEOUT
};
struct promise;
struct future;
typedef void (*future_success_cb)(void * result, void * user);
typedef void (*future_failed_cb)(enum e_future_error err, const char * what, void * user);
typedef void (*promise_ctx_destroy_cb)(struct promise* p);
struct future* future_create(future_success_cb * cb_success, future_failed_cb * cb_failed, void * user);
struct future* promise_to_future(struct promise* p);
struct promise* future_to_promise(struct future* f);