Skip to content

Extensions

Extensions are a way to extend aiotaskqueue, by handling certain events like task completion or errors, they're heavily inspired by StrawberryGraphQL Extensions.

Multiple interfaces can be implemented by a single class to avoid having to register multiple extensions for a single feature.

OnTaskCompletion

Called when task is successfully completed and the result is already stored in the ResultBackend.

OnTaskException

Called when an exception was raised during task execution.

OnTaskSchedule

Called when task is scheduled and added to the queue.

OnTaskExecution

Wraps task execution, working similarly to a middleware, it should return a value compatible with task return type.