Future
Object Hierarchy:
Description:
[ GenericAccessors ]
public interface Future<G> : Object
Future is a value which might not yet be computed - for example it is calculated in different thread or depends on I/O value.
All methods can be called from many threads as part of interface.
Note:
Statement that call does not block does not mean that it is lock-free. Internally the implementation is allowed to take mutex but it
should guarantee that it is not for a long time (including blocking on anything else, I/O calls or callbacks).
Since:
0.11.0
See also:
Promise, Lazy,
task, async_task
Content:
Properties:
Delegates:
Methods:
- public virtual Future<A> flat_map<A> (owned FlatMapFunc<A,G> func)
Maps a future value to another future value which is returned (call
does not block).
- public virtual Future<A> light_map<A> (owned LightMapFunc<A,G> func)
Maps a future value to another value by a function and returns the
another value in future.
- public virtual Future<A> light_map_broken<A> (LightMapFunc<A,G> func)
- public virtual Future<A> map<A> (owned MapFunc<A,G> func)
Maps a future value to another value by a function and returns the
another value in future.
- public abstract weak G wait () throws FutureError
Waits until the value is ready.
- public abstract async weak G wait_async () throws FutureError
Reschedules the callback until the
value is available.
- public abstract bool wait_until (int64 end_time, out G value = null) throws FutureError
Waits until the value is ready or deadline have passed.
- public virtual Future<B> zip<A,B> (owned ZipFunc<G,A,B> zip_func, Future<A> second)
Combines values of two futures using a function returning the combined
value in future (call does not block).
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref