class

D4::WriteControl

Inherits Reference < Object

Coordinates progress reporting and cooperative cancellation for D4 writes.

A control may be cancelled from another fiber or thread. Callbacks run in the fiber performing the write and should return quickly.

Constructors

new(on_progress : Proc(WriteProgress, Nil) | Nil = nil)
Source

Instance methods

cancel

Requests cancellation. The operation stops at its next checkpoint.

Source
cancelled?
Source
check!

Raises CancelledError when cancellation has been requested.

Source
update(progress : WriteProgress) : Nil

Emits a progress snapshot after checking for cancellation.

Source