notify_register_dispatch(_:_:_:_:)
Request notification delivery to a dispatch queue.
Declaration
func notify_register_dispatch(_ name: UnsafePointer<CChar>!, _ out_token: UnsafeMutablePointer<Int32>!, _ queue: dispatch_queue_t!, _ handler: notify_handler_t!) -> UInt32Parameters
- name:
(Input) The notification name.
- out_token:
(Output) The registration token.
- queue:
(Input) The dispatch queue to which the Block is submitted. The dispatch queue is retained by the notify subsystem while the notification is registered, and will be released when notification is canceled.
- handler:
(Input) The Block to invoke on the dispatch queue in response to a notification. The notification token is passed to the Block as an argument so that the callee can modify the state of the notification or cancel the registration.
Return Value
Returns status.
Discussion
When notifications are received by the process, the notify subsystem will deliver the registered Block to the target dispatch queue. Notification blocks are not re-entrant, and subsequent notification Blocks will not be delivered for the same registration until the previous Block has returned.