public function __construct() { // call parent constructor parent::__construct(); // create the asyncronous curl handler $this->handler = new CurlMultiHandler(); $httpClient = new Client(['handler' => HandlerStack::create($this->handler)]); // have the request wrapper call guzzle asyncronously $this->setRequestWrapper(new RequestWrapper(['scopes' => PubSubClient::FULL_CONTROL_SCOPE, 'httpHandler' => function ($request, $options = []) use($httpClient) { return $httpClient->sendAsync($request, $options); }, 'authHttpHandler' => HttpHandlerFactory::build()])); }