API Documentation

# \ConsumerStrategies_AbstractConsumer

Provides some base methods for use by a Consumer implementation

## Summary

Methods
Properties
Constants
__construct()
getNumThreads()
persist()
No public properties found
No constants found
_log()
_debug()
_encode()
_handleError()
$_options
N/A
No private methods found
$_defaults
N/A
abstract

File
  ConsumerStrategies/AbstractConsumer.php
Package
  Default
Class hierarchy
  \Base_MixpanelBase
  \ConsumerStrategies_AbstractConsumer

## Tags

None found

## Properties

### $_options

    $_options : array

An array of options to be used by the Mixpanel library.

#### Type

array

#

Inherited from
  \Base_MixpanelBase

## Tags

None found

### $_defaults

    $_defaults : array

Default options that can be overridden via the $options constructor arg

#### Type

array

#

Inherited from
  \Base_MixpanelBase

## Tags

None found

## Methods

### __construct()

    __construct(array  $options = array())

Creates a new AbstractConsumer

#### Parameters

array | $options |

#

## Tags

None found

### getNumThreads()

    getNumThreads() : integer

Number of requests/batches that will be processed in parallel.

#### Returns

integer

#

## Tags

None found

### persist()

    persist(array  $batch) : boolean

Persist a batch of messages in whatever way the implementer sees fit

#### Parameters

array | $batch | an array of messages to consume

#### Returns

boolean —

success or fail

#

abstract

## Tags

None found

### _log()

    _log(  $msg)

Log a message to PHP's error log

#### Parameters

| $msg |

#

Inherited from
  \Base_MixpanelBase

## Tags

None found

### _debug()

    _debug() : boolean

Returns true if in debug mode, false if in production mode

#### Returns

boolean

#

Inherited from
  \Base_MixpanelBase

## Tags

None found

### _encode()

    _encode(array  $params) : string

Encode an array to be persisted

#### Parameters

array | $params |

#### Returns

string

#

## Tags

None found

### _handleError()

    _handleError(  $code,   $msg)

Handles errors that occur in a consumer

#### Parameters

| $code |
| $msg |

#

## Tags

None found

### AbstractConsumer.php