Reactor

public protocol Reactor

A task reactor allows you to control what the task manager should do after a task is completed, and before the completion callback is called.

Multiple reactors

If a there’re multiple reactors that are supposed to be run for a task then the options set in the ReactorConfiguration are OR'ed together to determine what to do with the task. I.e. if one reactor of n reactors is configured to reqeue a task, then the task will be requeued.

  • Return true if you want this reactor to be executed

    Declaration

    Swift

    func shouldExecute<T>(after: T.Result, from: T, with: Handle) -> Bool where T : Task

    Parameters

    after

    the result of the task that was just executed

    from

    the actual task that was just executed

    with

    the handle to the task that was just executed

  • Does the interceptor work

    Declaration

    Swift

    func execute(done: @escaping (Error?) -> Void)
  • The configuration that this interceptor has

    Declaration

    Swift

    var configuration: ReactorConfiguration { get }