---
title: DispatchSourceProtocol
framework: dispatch
role: symbol
role_heading: Protocol
path: dispatch/dispatchsourceprotocol
---

# DispatchSourceProtocol

Defines a common set of properties and methods that are shared with all dispatch source types.

## Declaration

```swift
protocol DispatchSourceProtocol : NSObjectProtocol
```

## Overview

Overview You do not adopt this protocol in your objects. Instead, use the makeSignalSource(signal:queue:) method to create an object that adopts this protocol.

## Topics

### Activating, Suspending, and Resuming a Source

- [activate()](dispatch/dispatchsourceprotocol/activate().md)
- [suspend()](dispatch/dispatchsourceprotocol/suspend().md)
- [resume()](dispatch/dispatchsourceprotocol/resume().md)

### Canceling a Dispatch Source

- [cancel()](dispatch/dispatchsourceprotocol/cancel().md)
- [isCancelled](dispatch/dispatchsourceprotocol/iscancelled.md)
- [setCancelHandler(handler:)](dispatch/dispatchsourceprotocol/setcancelhandler(handler:).md)
- [setCancelHandler(qos:flags:handler:)](dispatch/dispatchsourceprotocol/setcancelhandler(qos:flags:handler:).md)

### Installing Event Handlers

- [setEventHandler(handler:)](dispatch/dispatchsourceprotocol/seteventhandler(handler:).md)
- [setEventHandler(qos:flags:handler:)](dispatch/dispatchsourceprotocol/seteventhandler(qos:flags:handler:).md)
- [setRegistrationHandler(handler:)](dispatch/dispatchsourceprotocol/setregistrationhandler(handler:).md)
- [setRegistrationHandler(qos:flags:handler:)](dispatch/dispatchsourceprotocol/setregistrationhandler(qos:flags:handler:).md)
- [DispatchSourceProtocol.DispatchSourceHandler](dispatch/dispatchsourceprotocol/dispatchsourcehandler.md)

### Getting the Dispatch Source Attributes

- [handle](dispatch/dispatchsourceprotocol/handle.md)
- [data](dispatch/dispatchsourceprotocol/data.md)
- [mask](dispatch/dispatchsourceprotocol/mask.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Inherited By

- [DispatchSourceFileSystemObject](dispatch/dispatchsourcefilesystemobject.md)
- [DispatchSourceMachReceive](dispatch/dispatchsourcemachreceive.md)
- [DispatchSourceMachSend](dispatch/dispatchsourcemachsend.md)
- [DispatchSourceMemoryPressure](dispatch/dispatchsourcememorypressure.md)
- [DispatchSourceProcess](dispatch/dispatchsourceprocess.md)
- [DispatchSourceRead](dispatch/dispatchsourceread.md)
- [DispatchSourceSignal](dispatch/dispatchsourcesignal.md)
- [DispatchSourceTimer](dispatch/dispatchsourcetimer.md)
- [DispatchSourceUserDataAdd](dispatch/dispatchsourceuserdataadd.md)
- [DispatchSourceUserDataOr](dispatch/dispatchsourceuserdataor.md)
- [DispatchSourceUserDataReplace](dispatch/dispatchsourceuserdatareplace.md)
- [DispatchSourceWrite](dispatch/dispatchsourcewrite.md)

### Conforming Types

- [DispatchSource](dispatch/dispatchsource.md)

## See Also

### System Event Monitoring

- [DispatchSource](dispatch/dispatchsource.md)
- [Dispatch Source](dispatch/dispatch-source.md)
- [DispatchIO](dispatch/dispatchio.md)
- [DispatchData](dispatch/dispatchdata.md)
- [DispatchDataIterator](dispatch/dispatchdataiterator.md)
- [Dispatch I/O](dispatch/dispatch-i-o.md)
- [Dispatch Data](dispatch/dispatch-data.md)
