Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
Future

Detailed Description

Data Structures

struct  reduct_future_t
 Future structure. More...
 

Macros

#define REDUCT_FUTURE_SMALL_MAX   2
 The maximum number of small arguments in a future.
 

Functions

REDUCT_API reduct_future_treduct_future_new (struct reduct *reduct, reduct_handle_t callable, size_t argc, reduct_handle_t *argv)
 Create a new future and start its execution.
 
static REDUCT_ALWAYS_INLINE reduct_handle_t reduct_future_join (struct reduct *reduct, reduct_future_t *future)
 Wait for the future to complete and return its result.
 
static REDUCT_ALWAYS_INLINE bool reduct_future_is_done (struct reduct *reduct, reduct_future_t *future)
 Check if the future is finished.
 

Macro Definition Documentation

◆ REDUCT_FUTURE_SMALL_MAX

#define REDUCT_FUTURE_SMALL_MAX   2

The maximum number of small arguments in a future.

Definition at line 21 of file future.h.

Function Documentation

◆ reduct_future_new()

REDUCT_API reduct_future_t * reduct_future_new ( struct reduct *  reduct,
reduct_handle_t  callable,
size_t  argc,
reduct_handle_t argv 
)

Create a new future and start its execution.

Parameters
reductPointer to the Reduct structure.
callableThe callable handle.
argcThe number of arguments.
argvPointer to the arguments array.
Returns
Pointer to the new future.

◆ reduct_future_join()

static REDUCT_ALWAYS_INLINE reduct_handle_t reduct_future_join ( struct reduct *  reduct,
reduct_future_t future 
)
inlinestatic

Wait for the future to complete and return its result.

Parameters
reductPointer to the Reduct structure.
futurePointer to the future.
Returns
The result handle.

Definition at line 60 of file future.h.

Here is the call graph for this function:

◆ reduct_future_is_done()

static REDUCT_ALWAYS_INLINE bool reduct_future_is_done ( struct reduct *  reduct,
reduct_future_t future 
)
inlinestatic

Check if the future is finished.

Parameters
reductPointer to the Reduct structure.
futurePointer to the future.
Returns
true if done, false otherwise.

Definition at line 82 of file future.h.