class GLib::SourceFuncs
- GLib::SourceFuncs
- Reference
- Object
Overview
The GSourceFuncs
struct contains a table of
functions used to handle event sources in a generic manner.
For idle sources, the prepare and check functions always return true
to indicate that the source is always ready to be processed. The prepare
function also returns a timeout value of 0 to ensure that the poll() call
doesn't block (since that would be time wasted which could have been spent
running the idle function).
For timeout sources, the prepare and check functions both return true
if the timeout interval has expired. The prepare function also returns
a timeout value to ensure that the poll() call doesn't block too long
and miss the next timeout.
For file descriptor sources, the prepare function typically returns false
,
since it must wait until poll() has been called before it knows whether
any events need to be processed. It sets the returned timeout to -1 to
indicate that it doesn't mind how long the poll() call blocks. In the
check function, it tests the results of the poll() call to see if the
required condition has been met, and returns true
if so.
Defined in:
lib/gi-crystal/src/auto/g_lib-2.0/source_funcs.crConstructors
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
- .new(data : LibGLib::SourceFuncs, transfer : GICrystal::Transfer)
- .new(prepare : GLib::Prepare | Nil = nil, check : GLib::Check | Nil = nil, finalize : GLib::Finalize | Nil = nil, closure_callback : GLib::SourceFunc | Nil = nil, closure_marshal : GLib::SourceDummyMarshal | Nil = nil)
Instance Method Summary
-
#==(other : self) : Bool
Returns
true
if this reference is the same as other. - #_finalize : GLib::Finalize
- #_finalize=(value : GLib::Finalize)
- #check : GLib::Check
- #check=(value : GLib::Check)
- #closure_callback : GLib::SourceFunc
- #closure_callback=(value : GLib::SourceFunc)
- #closure_marshal : GLib::SourceDummyMarshal
- #closure_marshal=(value : GLib::SourceDummyMarshal)
- #dispatch : Pointer(Void) | Nil
- #dispatch!
- #prepare : GLib::Prepare
- #prepare=(value : GLib::Prepare)
- #to_unsafe
Constructor Detail
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.