Reads file data asynchronously : a single IO thread is shared by all file systems, reading the pending requests by priority order.

The completion callback is called in the thread that requested the read, through its event loop (the main thread loop is run by heaps, other threads need to have an event loop running).

When async reads are not supported (non-threaded target, or ENABLED=false), the reads are emulated : they are done synchronously at the next event loop of the calling thread, in requests order, and the callbacks are called the same way.

Static variables

@:value(true)staticENABLED:Bool = true

Set to false to emulate all async reads synchronously.

Static methods

staticisAsync():Bool

staticread(entry:FileEntry, out:Bytes, outPos:Int, pos:Int, len:Int, onDone:Int ‑> Void, priority:Float):AsyncRead