22declare(strict_types=1);
29use
function igbinary_serialize;
30use
function igbinary_unserialize;
38 private const TLS_KEY_COMPLETION_CALLBACK =
"completionCallback";
40 private string $operations;
52 public function __construct(array $operations, \Closure $onCompletion){
53 $this->operations = igbinary_serialize($operations);
54 $this->
storeLocal(self::TLS_KEY_COMPLETION_CALLBACK, $onCompletion);
62 $operations = igbinary_unserialize($this->operations);
64 foreach($operations as $op){
66 $results[] =
Internet::simpleCurl($op->getPage(), $op->getTimeout(), $op->getExtraHeaders(), $op->getExtraOpts());
71 $this->setResult($results);
79 $callback = $this->fetchLocal(self::TLS_KEY_COMPLETION_CALLBACK);
81 $results = $this->getResult();
storeLocal(string $key, mixed $complexData)
__construct(array $operations, \Closure $onCompletion)
static simpleCurl(string $page, float $timeout=10, array $extraHeaders=[], array $extraOpts=[], ?\Closure $onSuccess=null)