403Webshell
Server IP : 62.72.47.131  /  Your IP : 216.73.217.34
Web Server : Apache/2.4.66 (Debian)
System : Linux 975cdb959a49 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
User :  ( 501)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/woocommerce/lib/packages/GraphQL/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/woocommerce/lib/packages/GraphQL/Deferred.php
<?php declare(strict_types=1);

namespace Automattic\WooCommerce\Vendor\GraphQL;

use Automattic\WooCommerce\Vendor\GraphQL\Executor\Promise\Adapter\SyncPromise;
use Automattic\WooCommerce\Vendor\GraphQL\Executor\Promise\Adapter\SyncPromiseQueue;

/**
 * User-facing promise class for deferred field resolution.
 *
 * @phpstan-type Executor callable(): mixed
 */
class Deferred extends SyncPromise
{
    /**
     * Executor for deferred promises.
     *
     * @var (callable(): mixed)|null
     */
    protected $executor;

    /**
     * Create a new Deferred promise and enqueue its execution.
     *
     * @api
     *
     * @param Executor $executor
     */
    public function __construct(callable $executor)
    {
        $this->executor = $executor;

        SyncPromiseQueue::enqueue(function (): void {
            $executor = $this->executor;
            assert($executor !== null, 'Always set in constructor, this callback runs only once.');
            $this->executor = null;

            try {
                $this->resolve($executor());
            } catch (\Throwable $e) {
                $this->reject($e);
            }
        });
    }

    /**
     * Alias for __construct.
     *
     * @param Executor $executor
     *
     * @deprecated TODO remove in next major version, use new Deferred() instead
     */
    public static function create(callable $executor): self
    {
        return new self($executor);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit