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: 262 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CurlMultiHandler:: (10 methods):
  __construct()
  __get()
  __destruct()
  __invoke()
  tick()
  execute()
  addRequest()
  cancel()
  processMessages()
  timeToNext()


Class: CurlMultiHandler  - X-Ref

Returns an asynchronous response using curl_multi_* functions.

When using the CurlMultiHandler, custom curl options can be specified as an
associative array of curl option constants mapping to values in the
**curl** key of the provided request options.

__construct(array $options = [])   X-Ref
This handler accepts the following options:

- handle_factory: An optional factory  used to create curl handles
- select_timeout: Optional timeout (in seconds) to block before timing
out while selecting curl handles. Defaults to 1 second.
- options: An associative array of CURLMOPT_* options and
corresponding values for curl_multi_setopt()

__get($name)   X-Ref

param: string $name
return: resource|\CurlMultiHandle

__destruct()   X-Ref
No description

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

tick()   X-Ref
No description

execute()   X-Ref
Runs until all outstanding connections have completed.


addRequest(array $entry)   X-Ref
No description

cancel($id)   X-Ref
Cancels a handle from sending and removes references to it.

param: int $id Handle ID to cancel and remove.
return: bool True on success, false on failure.

processMessages()   X-Ref
No description

timeToNext()   X-Ref
No description