DispatchSource
class DispatchSourceclass DispatchSourceimport Dispatchclass DispatchObjectprotocol DispatchSourceProtocolprotocol DispatchSourceRead : DispatchSourceProtocolprotocol DispatchSourceSignal : DispatchSourceProtocolprotocol DispatchSourceTimer : DispatchSourceProtocolprotocol DispatchSourceUserDataAdd : DispatchSourceProtocolprotocol DispatchSourceUserDataOr : DispatchSourceProtocolprotocol DispatchSourceUserDataReplace : DispatchSourceProtocolprotocol DispatchSourceWrite : DispatchSourceProtocolprotocol SendableA thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
class func makeReadSource(fileDescriptor: Int32, queue: DispatchQueue? = nil) -> any DispatchSourceRead class func makeSignalSource(signal: Int32, queue: DispatchQueue? = nil) -> any DispatchSourceSignal class func makeTimerSource(flags: DispatchSource.TimerFlags = [], queue: DispatchQueue? = nil) -> any DispatchSourceTimer class func makeUserDataAddSource(queue: DispatchQueue? = nil) -> any DispatchSourceUserDataAdd class func makeUserDataOrSource(queue: DispatchQueue? = nil) -> any DispatchSourceUserDataOr class func makeUserDataReplaceSource(queue: DispatchQueue? = nil) -> any DispatchSourceUserDataReplace class func makeWriteSource(fileDescriptor: Int32, queue: DispatchQueue? = nil) -> any DispatchSourceWrite struct FileSystemEventstruct TimerFlagsvar data: UInt { get }var handle: UInt { get }var isCancelled: Bool { get }var mask: UInt { get }func add(data: UInt) Merges data into a dispatch source of type DISPATCH_SOURCE_TYPE_DATA_ADD and submits its event handler block to its target queue.
func cancel() func or(data: UInt) Merges data into a dispatch source of type DISPATCH_SOURCE_TYPE_DATA_OR and submits its event handler block to its target queue.
func replace(data: UInt) Merges data into a dispatch source of type DISPATCH_SOURCE_TYPE_DATA_REPLACE and submits its event handler block to its target queue.
func schedule(deadline: DispatchTime, repeating interval: DispatchTimeInterval = .never, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, repeat interval and leeway for a timer event.
func schedule(deadline: DispatchTime, repeating interval: Double, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, repeat interval and leeway for a timer event.
func schedule(wallDeadline: DispatchWallTime, repeating interval: DispatchTimeInterval = .never, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, repeat interval and leeway for a timer event.
func schedule(wallDeadline: DispatchWallTime, repeating interval: Double, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, repeat interval and leeway for a timer event that fires at least once.
func setCancelHandler(handler: DispatchWorkItem) func setCancelHandler(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], handler: DispatchSourceHandler?) func setEventHandler(handler: DispatchWorkItem) func setEventHandler(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], handler: DispatchSourceHandler?) func setRegistrationHandler(handler: DispatchWorkItem) func setRegistrationHandler(qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], handler: DispatchSourceHandler?) func scheduleOneshot(deadline: DispatchTime, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline and leeway for a timer event that fires once.
func scheduleOneshot(wallDeadline: DispatchWallTime, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline and leeway for a timer event that fires once.
func scheduleRepeating(deadline: DispatchTime, interval: DispatchTimeInterval, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, interval and leeway for a timer event that fires at least once.
func scheduleRepeating(deadline: DispatchTime, interval: Double, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, interval and leeway for a timer event that fires at least once.
func scheduleRepeating(wallDeadline: DispatchWallTime, interval: DispatchTimeInterval, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, interval and leeway for a timer event that fires at least once.
func scheduleRepeating(wallDeadline: DispatchWallTime, interval: Double, leeway: DispatchTimeInterval = .nanoseconds(0)) Sets the deadline, interval and leeway for a timer event that fires at least once.