DispatchSource Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
DispatchSource is a base class used to reprenset event sources that can monitor a variety of system objects and events including file descriptors, mach ports, processes, virtual filesystem nodes, signal delivery and timers.
public class DispatchSource : CoreFoundation.DispatchObject
type DispatchSource = class
inherit DispatchObject
- Inheritance
- Inheritance
- Derived
Remarks
Dispatch event sources may be used to monitor a variety of system objects and events including file descriptors, mach ports, processes, virtual filesystem nodes, signal delivery and timers. To monitor a specific kind of source, you create an instance of one of the DispatchSource subclasses:
- DispatchSource.DataAdd :
- DispatchSource.DataOr :
- DispatchSource.MachReceive :
- DispatchSource.MachSend :
- DispatchSource.MemoryPressure :
- DispatchSource.ProcessMonitor :
- DispatchSource.ReadMonitor :
- DispatchSource.SignalMonitor :
- DispatchSource.Timer :
- DispatchSource.VnodeMonitor :
- DispatchSource.WriteMonitor :
When a state change occurs, the dispatch source will submit its event handler block to its target queue.
Newly created sources are created in a suspended state. After the source has been configured by setting an event handler, cancellation handler, registration handler, context, etc., the source must be activated by a call to Resume() before any events will be delivered.
Source Event Handlers
null
as an argument. Registration
Cancellation
Properties
Handle | (Inherited from DispatchObject) |
IsCanceled |
Determine whether the specified source has been canceled. |
Methods
Activate() | (Inherited from DispatchObject) |
Cancel() |
Asynchronously cancels the dispatch source. |
Check() |
Obsolete.
(Inherited from DispatchObject)
|
Dispose() | (Inherited from DispatchObject) |
Dispose(Boolean) |
Releases the resources used by the DispatchSource object. |
Equals(Object) | (Inherited from DispatchObject) |
GetHashCode() |
Returns the hashcode for this object (Inherited from DispatchObject) |
InitializeHandle(IntPtr) | (Inherited from NativeObject) |
Release() | (Inherited from DispatchObject) |
Resume() |
Resumes the dispatch source. |
Retain() | (Inherited from DispatchObject) |
SetCancelHandler(Action) |
Provides a cancellation handler |
SetEventHandler(Action) |
Specified a handler to execute when events are received on the dispatch source. |
SetRegistrationHandler(Action) |
Provides a registration handler |
SetTargetQueue(DispatchQueue) | (Inherited from DispatchObject) |
Suspend() |
Suspends the dispatch source. |