baseUrl = $params['mcrdConfig']['url']; $httpConfig = isset( $params['httpConfig'] ) ? $params['httpConfig'] : array(); if ( !isset( $httpConfig['connTimeout'] ) ) { $httpConfig['connTimeout'] = 1; } if ( !isset( $httpConfig['reqTimeout'] ) ) { $httpConfig['reqTimeout'] = .25; } $this->http = new MultiHttpClient( $httpConfig ); } protected function doNotify( $channel, array $events ) { if ( !count( $events ) ) { return true; } $response = $this->http->run( array( 'url' => "{$this->baseUrl}/relayer/api/v1.0/" . rawurlencode( $channel ), 'method' => 'POST', 'body' => json_encode( array( 'events' => $events ) ), 'headers' => array( 'content-type' => 'application/json' ) ) ); return $response['code'] == 201; } }