Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 116 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

RetryMiddleware:: (6 methods):
  __construct()
  exponentialDelay()
  __invoke()
  onFulfilled()
  onRejected()
  doRetry()


Class: RetryMiddleware  - X-Ref

Middleware that retries requests based on the boolean result of
invoking the provided "decider" function.

__construct(callable $decider, callable $nextHandler, callable $delay = null)   X-Ref

param: callable                                            $decider     Function that accepts the number of retries,
param: callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
param: (callable(int): int)|null                           $delay       Function that accepts the number of retries

exponentialDelay(int $retries)   X-Ref
Default exponential backoff delay function.

return: int milliseconds.

__invoke(RequestInterface $request, array $options)   X-Ref
No description

onFulfilled(RequestInterface $request, array $options)   X-Ref
Execute fulfilled closure


onRejected(RequestInterface $req, array $options)   X-Ref
Execute rejected closure


doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)   X-Ref
No description