Future.with_deadline


Description:

[ CCode ( cname = "dex_future_with_deadline" , has_construct_function = false ) ]
[ Version ( since = "1.2" ) ]
public Future.with_deadline (owned Future future, int64 deadline)

Creates a new [class@Dex.

Future] that resolves or rejects with the same result as future, unless deadline is reached first. If the deadline is reached first, the returned future rejects with dex_error_timed_out and discards future.

Parameters:

future

a [class@Dex.Future]

deadline

a deadline in usec in the monotonic clock

Returns:

a [class@Dex.Future]