public function requestAsync(
        string $method,
        $params = [],
        ?callable $fulfilled = null,
        ?callable $rejected = null) : Promise\Promise
    {
        $promise = $this->client
            ->postAsync($this->path, $this->makeJson($method, $params));

        $promise->then(function ($response) use ($fulfilled) {
            $this->onSuccess($response, $fulfilled);
        });

        $promise->otherwise(function ($exception) use ($rejected) {
            try {
                exception()->handle($exception);
            } catch (Throwable $exception) {
                $this->onError($exception, $rejected);
            }
        });

        $this->promises[] = $promise;

        return $promise;
    }
public function requestAsync(
        string $method,
        $params = [],
        ?callable $fulfilled = null,
        ?callable $rejected = null) : Promise\Promise
    {
        $promise = $this->client
            ->postAsync($this->path, $this->makeJson($method, $params));

        $promise->then(function ($response) use ($fulfilled) {
            $this->onSuccess($response, $fulfilled);
        });

        $promise->otherwise(function ($exception) use ($rejected) {
            try {
                exception()->handle($exception);
            } catch (Throwable $exception) {
                $this->onError($exception, $rejected);
            }
        });

        $this->promises[] = $promise;

        return $promise;
    }
public function requestAsync ( string $ method , $ params = [ ] , ? callable $ fulfilled = null , ? callable $ rejected = null ) : Promise \ Promise { $ promise = $ this -> client -> postAsync ( $ this -> path , $ this -> makeJson ( $ method , $ params ) ) ; $ promise -> then ( function ( $ response ) use ( $ fulfilled ) { $ this -> onSuccess ( $ response , $ fulfilled ) ; } ) ; $ promise -> otherwise ( function ( $ exception ) use ( $ rejected ) { try { exception ( ) -> handle ( $ exception ) ; } catch ( Throwable $ exception ) { $ this -> onError ( $ exception , $ rejected ) ; } } ) ; $ this -> promises [ ] = $ promise ; return $ promise ; }
Makes async request to Bitcoin Core.

@param string        $method
@param mixed         $params
@param callable|null $fulfilled
@param callable|null $rejected

@return \GuzzleHttp\Promise\Promise
Makes async request to Bitcoin Core .