SparkPost\SparkPostPromise::wait PHP Method

wait() public method

Wraps the wait function and returns a custom response or throws a custom exception.
public wait ( boolean $unwrap = true ) : SparkPostResponse
$unwrap boolean
return SparkPostResponse
    public function wait($unwrap = true)
    {
        try {
            $response = $this->promise->wait($unwrap);
            return $response ? new SparkPostResponse($response) : $response;
        } catch (\Exception $exception) {
            throw new SparkPostException($exception);
        }
    }