CancellableSource


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "2.28" ) ]
public CancellableSource (Cancellable? cancellable)

Creates a source that triggers if this is cancelled and calls its callback of type CancellableSourceFunc.

This is primarily useful for attaching to another (non-cancellable) source with add_child_source to add cancellability to it.

For convenience, you can call this with a null Cancellable, in which case the source will never trigger.

The new SocketSource will hold a reference to the Cancellable.

Parameters:

this

a Cancellable, or null

Returns:

the new SocketSource.