$_defaults $_defaults : array Default options that can be overridden via the $options constructor arg Type array
$_connect_timeout $_connect_timeout : integer Type integer — connect_timeout the socket connection timeout in seconds
__construct() __construct(array $options = array()) Creates a new SocketConsumer and assigns properties from the $options array Parameters array $options
getNumThreads() getNumThreads() : integer Number of requests/batches that will be processed in parallel. Returns integer
persist() persist(array $batch) : boolean Write using a persistent socket connection. Parameters array $batch an array of messages to consume Returns boolean
_encode() _encode(array $params) : string Encode an array to be persisted Parameters array $params Returns string
_handleError() _handleError( $code, $msg) Handles errors that occur in a consumer Parameters $code $msg
_debug() _debug() : boolean Returns true if in debug mode, false if in production mode Returns boolean
_getSocket() _getSocket() : boolean|resource Return cached socket if open or create a new persistent socket Returns boolean|resource
_createSocket() _createSocket(boolean $retry = true) : boolean|resource Attempt to open a new socket connection, cache it, and return the resource Parameters boolean $retry Returns boolean|resource
_write() _write( $socket, $data, boolean $retry = true) : boolean Write $data through the given $socket Parameters $socket $data boolean $retry Returns boolean
handleResponse() handleResponse( $response) : array Parse the response from a socket write (only used for debugging) Parameters $response Returns array