---
title: dispatch_source_get_data
framework: dispatch
role: symbol
role_heading: Function
path: dispatch/dispatch_source_get_data
---

# dispatch_source_get_data

Returns pending data for the dispatch source.

## Declaration

```occ
extern uintptr_t dispatch_source_get_data(dispatch_source_t source);
```

## Parameters

- `source`: This parameter cannot be NULL.

## Return Value

Return Value The return value should be interpreted according to the type of the dispatch source, and can be one of the following: DISPATCH_SOURCE_TYPE_DATA_ADD: application-defined data DISPATCH_SOURCE_TYPE_DATA_OR: application-defined data DISPATCH_SOURCE_TYPE_MACH_SEND: Dispatch Source Mach Send Event Flags DISPATCH_SOURCE_TYPE_MACH_RECV: not applicable DISPATCH_SOURCE_TYPE_PROC: Dispatch Source Process Event Flags DISPATCH_SOURCE_TYPE_READ: estimated bytes available to read DISPATCH_SOURCE_TYPE_SIGNAL: number of signals delivered since the last handler invocation DISPATCH_SOURCE_TYPE_TIMER: number of times the timer has fired since the last handler invocation DISPATCH_SOURCE_TYPE_VNODE: Dispatch Source Vnode Event Flags Dispatch Source Memory Pressure Event Flags: estimated buffer space available Discussion Call this function from within the event handler block. The result of calling this function outside of the event handler callback is undefined.

## See Also

### Getting Dispatch Source Attributes

- [dispatch_source_get_mask](dispatch/dispatch_source_get_mask.md)
- [dispatch_source_get_handle](dispatch/dispatch_source_get_handle.md)
- [dispatch_source_merge_data](dispatch/dispatch_source_merge_data.md)
- [dispatch_source_proc_flags_t](dispatch/dispatch_source_proc_flags_t.md)
- [dispatch_source_vnode_flags_t](dispatch/dispatch_source_vnode_flags_t.md)
- [dispatch_source_mach_recv_flags_t](dispatch/dispatch_source_mach_recv_flags_t.md)
- [dispatch_source_mach_send_flags_t](dispatch/dispatch_source_mach_send_flags_t.md)
- [dispatch_source_memorypressure_flags_t](dispatch/dispatch_source_memorypressure_flags_t.md)
