Interceptor
public protocol Interceptor
A task interceptor allows you to somewhat control what the task manager should do when it encounters a task. The intercept function will be called before the task is executing. This allows you to control the state of the task based on state that you may be interested in.
Interception commands
After the intercept function is executed, there’re a number of commands that can be given to the task manager to tell it what to do with the task. The intercept function also contains a current batch count, which tells you how many tasks are being held on to by this interceptor.
See also
InterceptCommand
-
This is called on every task and allows you to tell the task manager how to treat this task based on the
InterceptCommand
that you returnDeclaration
Swift
func intercept<T>(task: inout T, currentBatchCount: Int) -> InterceptCommand where T : Task