DispatchQueue

@objc public protocol DispatchQueue

Define the interface of message loop.

App need implement this interface and runs a message loop to process the message/task one by one. All callback will be invoked from this queue.

  • Put a task to the queue.

    Note: This method must be thread safe and task must be executed out of current call stack.

    • Parameters:
      • task: The task will be executed from the message loop.

    Declaration

    Swift

    func dispatch(task task: () -> ());

    Parameters

    task

    The task will be executed from the message loop.