Platforms to show: All Mac Windows Linux Cross-Platform
DispatchIOMBS class New in 25.3
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | DispatchIO | MBS MacOSX Plugin | 25.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
One or more dispatch I/O channels may be created from a file descriptor as either the kTypeStream type or kTypeRandom type. Once a channel has been created the application may schedule asynchronous read and write operations.
The application may set policies on the dispatch I/O channel to indicate the desired frequency of I/O handlers for long-running operations.
Dispatch I/O also provides a memory management model for I/O buffers that avoids unnecessary copying of data when pipelined between channels. Dispatch I/O monitors the overall memory pressure and I/O access patterns for the application to optimize resource utilization.
- 4 events
- event BarrierCompleted
- event Closing(error as Integer)
- event ReadCompleted(offset as Int64, Data as DispatchDataMBS, done as Boolean, Error as Integer)
- event WriteCompleted(offset as Int64, OriginalData as DispatchDataMBS, RemainingData as DispatchDataMBS, done as Boolean, Error as Integer)
- 9 properties
- property Descriptor as Integer
- property Handle as Integer
- property HighWater as UInt64
- property Interval as UInt64
- property IntervalFlags as Integer
- property LowWater as UInt64
- property Path as String
- property Tag as Variant
- property Type as Integer
- 8 methods
- method Barrier(theDelegate as DispatchIOBarrierMBS = nil)
- method Close(flags as Integer = 0)
- method Constructor(type as Integer, File as FolderItem, OFlag as Integer = &h200, Mode as Integer = &o755)
- method Constructor(type as Integer, Other as DispatchIOMBS)
- method Constructor(type as Integer, Path as String, OFlag as Integer = &h200, Mode as Integer = &o755)
- method Constructor(type as Integer, Stream as BinaryStream)
- method Read(offset as Int64, length as UInt64, theDelegate as DispatchIOReadMBS = nil)
- method Write(offset as Int64, Data as DispatchDataMBS, theDelegate as DispatchIOWriteMBS = nil)
- 2 shared methods
- shared method ReadStream(Stream as BinaryStream, Length as UInt64, theDelegate as DispatchIOReadStreamMBS)
- shared method WriteStream(Stream as BinaryStream, Data as DispatchDataMBS, theDelegate as DispatchIOWriteStreamMBS)
- 5 delegates
- delegate DispatchIOBarrierMBS(DispatchIO as DispatchIOMBS)
- delegate DispatchIOReadMBS(DispatchIO as DispatchIOMBS, offset as Int64, Data as DispatchDataMBS, done as Boolean, Error as Integer)
- delegate DispatchIOReadStreamMBS(Stream as BinaryStream, Length as UInt64, Data as DispatchDataMBS, Error as Integer)
- delegate DispatchIOWriteMBS(DispatchIO as DispatchIOMBS, offset as Int64, OriginalData as DispatchDataMBS, RemainingData as DispatchDataMBS, done as Boolean, Error as Integer)
- delegate DispatchIOWriteStreamMBS(Stream as BinaryStream, OriginalData as DispatchDataMBS, RemainingData as DispatchDataMBS, Error as Integer)
- 10 constants
Flags
Constant | Value | Description |
---|---|---|
kCloseFlagStop | 1 |
If used, the system will make a best effort to interrupt any outstanding read and write operations on the I/O channel, otherwise those operations will run to completion normally. P |
kIntervalFlagStrictInterval | 1 |
Enqueue I/O handlers at a channel's interval setting even if the amount of data ready to be delivered is inferior to the low water mark (or zero). |
kOFlagAppend | 8 |
Append to existing file |
kOFlagCreate | &h200 |
Create file if it doesn't exist. |
kOFlagReadOnly | 0 |
Open file read only. |
kOFlagReadWrite | 2 |
Open file read & write. |
kOFlagTruncate | &h400 |
Truncate existing file. |
kOFlagWriteOnly | 1 |
Open file write only. |
kTypeRandom | 1 |
A dispatch I/O channel representing a random access file. Read and write operations on a channel of this type may be performed concurrently and read/write data at the specified offset. Offsets are interpreted relative to the file pointer position current at the time the I/O channel is created. Attempting to create a channel of this type for a file descriptor that is not seekable will result in an error. |
kTypeStream | 0 |
A dispatch I/O channel representing a stream of bytes. Read and write operations on a channel of this type are performed serially (in order of creation) and read/write data at the file pointer position that is current at the time the operation starts executing. Operations of different type (read vs. write) may be performed simultaneously. Offsets passed to operations on a channel of this type are ignored. |
This class has no sub classes.
Blog Entries
Release notes
- Version 25.3
- Added DispatchDataMBS or DispatchIOMBS classes.
Some related classes:
The items on this page are in the following plugins: MBS MacOSX Plugin.
