PollableOutputStream.createSource

Creates a #GSource that triggers when stream can be written, or cancellable is triggered or an error occurs. The callback on the source is of the #GPollableSourceFunc type.

As with gio.pollable_output_stream.PollableOutputStream.isWritable, it is possible that the stream may not actually be writable even after the source triggers, so you should use gio.pollable_output_stream.PollableOutputStream.writeNonblocking rather than gio.output_stream.OutputStream.write from the callback.

The behaviour of this method is undefined if gio.pollable_output_stream.PollableOutputStream.canPoll returns false for stream.

interface PollableOutputStream
createSource

Parameters

cancellable gio.cancellable.Cancellable

a #GCancellable, or null

Return Value

Type: glib.source.Source

a new #GSource