PHP Class Segment_Consumer_Socket

Inheritance: extends Segment_QueueConsumer
Datei anzeigen Open project: segmentio/analytics-php

Protected Properties

Property Type Description
$type

Public Methods

Method Description
__construct ( string $secret, array $options = [] ) Creates a new socket consumer for dispatching async requests immediately
flushBatch ( $batch )

Private Methods

Method Description
createBody ( string $host, string $content ) : string Create the body to send as the post request.
createSocket ( )
makeRequest ( stream $socket, string $req, $retry = true ) : boolean Attempt to write the request to the socket, wait for response if debug mode is enabled.
parseResponse ( string $res ) : array Parse our response from the server, check header and body.

Method Details

__construct() public method

Creates a new socket consumer for dispatching async requests immediately
public __construct ( string $secret, array $options = [] )
$secret string
$options array number "timeout" - the timeout for connecting function "error_handler" - function called back on errors. boolean "debug" - whether to use debug output, wait for response.

flushBatch() public method

public flushBatch ( $batch )

Property Details

$type protected_oe property

protected $type