Contents

SetDataServicedHandler

Installs the handler block to execute when data is removed from the queue.

Declaration

virtual kern_return_t SetDataServicedHandler(OSAction *action);

Parameters

  • action:

    The Osaction object that contains the callback method to execute. The data queue retains your action object until you install a new handler or cancel the dispatch source. The system executes your callback on the dispatch queue you designated in your Osaction object.

Return Value

kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

Discussion

If your code produces data for the queue, use this method to install a handler so you can add more data to the queue. When space becomes available in the queue, the system executes your handler.

See Also

Adding Work to the Queue