Gio.PollableOutputStream::write_nonblocking

function vfunc_write_nonblocking(buffer: ByteArray): Number(gssize) {
}
  

Attempts to write up to count bytes from buffer to stream, as with Gio.OutputStream.prototype.write. If stream is not currently writable, this will immediately return Gio.IOErrorEnum.would_block, and you can use Gio.PollableOutputStream.prototype.create_source to create a GLib.Source that will be triggered when stream is writable.

Note that since this method never blocks, you cannot actually use @cancellable to cancel it. However, it will return an error if @cancellable has already been cancelled when you call, which may happen if you call this method after a source triggers due to having been cancelled.

buffer

a buffer to write data from

Returns

the number of bytes written, or -1 on error (including Gio.IOErrorEnum.would_block).