Event
Object Hierarchy:
Bump.Event
Bump.Event
Bump.Event
GLib.Object
GLib.Object
GLib.Object->Bump.Event
Description:
public class Event <T > : Object
An event
An event is a bit like a signal where all handlers are dispatched immediately. In other words, as soon as the event is triggered, all
background tasks will be passed to the pool , all idle callback tasks will be added to
the idle queue, and all blocking tasks will be woken.
An interesting side-effect of this is that Event.SourceFunc callbacks can be
executed after they return false, since other events may have caused the callback to be queued again. If you want to make sure that a
callback is not invoked again you should use the cancellable.
Content:
Properties:
public bool auto_reset { get ; construct ; }
Whether to automatically reset the event after dispatching the
handlers
public TaskQueue pool { get ; construct ; }
The pool used to execute background tasks
public bool triggered { get ; }
Whether or not the event is currently triggered
Delegates:
public delegate R Callback <A ,R > (A arg) throws Error
public delegate bool SourceFunc <A > (A arg)
Creation methods:
public Event (bool auto_reset = true )
Create a new Event
Methods:
public void add (owned SourceFunc <T > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Add a callback to be executed in the idle queue
public R execute <R > (Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Execute the callback and wait for the result
public async R execute_async <R > (Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Execute the callback asynchronously
public async R execute_background <R > (Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Execute the callback asynchronously
public void reset ()
public void trigger (T value) throws Error
Trigger the event
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