O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dispatch Sources

Dispatch sources represent streams of events. When an event associated with a dispatch source occurs, an event handler (such as a block) is scheduled on a designated queue. You make a new dispatch source with dispatch_source_create():

dispatch_source_t dispatch_source_create (dispatch_source_type_t type,
                                          uintptr_t handle,
                                          unsigned long mask,
                                          dispatch_queue_t queue);

type is one of these constants:

 ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​D​A​T​A​_​A​D​D​ ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​D​A​T​A​_​O​R​ ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​M​A​C​H​_​S​E​N​D​ ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​M​A​C​H​_​R​E​C​V​ ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​P​R​O​C​ ​ ​D​I​S​P​A​T​C​H​_​S​O​U​R​C​E​_​T​Y​P​E​_​R​E​A​D​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required