PHP Class Segment_QueueConsumer

Inheritance: extends Segment_Consumer
ファイルを表示 Open project: segmentio/analytics-php Class Usage Examples

Protected Properties

Property Type Description
$batch_size
$max_queue_size
$queue
$type

Public Methods

Method Description
__construct ( string $secret, array $options = [] ) Store our secret and options as part of this consumer
__destruct ( )
alias ( array $message ) : boolean Aliases from one user id to another
flush ( ) Flushes our queue of messages by batching them to the server
flushBatch ( [type] $batch ) : [type] Flushes a batch of messages.
group ( array $message ) : boolean Tags traits about the group.
identify ( array $message ) : boolean Tags traits about the user.
page ( array $message ) : boolean Tracks a page view.
screen ( array $message ) : boolean Tracks a screen view.
track ( array $message ) : boolean Tracks a user action

Protected Methods

Method Description
enqueue ( mixed $item ) : boolean Adds an item to our queue.
payload ( $batch ) : {Array} Given a batch of messages the method returns a valid payload.

Method Details

__construct() public method

Store our secret and options as part of this consumer
public __construct ( string $secret, array $options = [] )
$secret string
$options array

__destruct() public method

public __destruct ( )

alias() public method

Aliases from one user id to another
public alias ( array $message ) : boolean
$message array
return boolean whether the alias call succeeded

enqueue() protected method

Adds an item to our queue.
protected enqueue ( mixed $item ) : boolean
$item mixed
return boolean whether call has succeeded

flush() public method

Flushes our queue of messages by batching them to the server
public flush ( )

flushBatch() abstract public method

Flushes a batch of messages.
abstract public flushBatch ( [type] $batch ) : [type]
$batch [type]
return [type]

group() public method

Tags traits about the group.
public group ( array $message ) : boolean
$message array
return boolean whether the group call succeeded

identify() public method

Tags traits about the user.
public identify ( array $message ) : boolean
$message array
return boolean whether the identify call succeeded

page() public method

Tracks a page view.
public page ( array $message ) : boolean
$message array
return boolean whether the page call succeeded

payload() protected method

Given a batch of messages the method returns a valid payload.
protected payload ( $batch ) : {Array}
return {Array}

screen() public method

Tracks a screen view.
public screen ( array $message ) : boolean
$message array
return boolean whether the screen call succeeded

track() public method

Tracks a user action
public track ( array $message ) : boolean
$message array
return boolean whether the track call succeeded

Property Details

$batch_size protected_oe property

protected $batch_size

$max_queue_size protected_oe property

protected $max_queue_size

$queue protected_oe property

protected $queue

$type protected_oe property

protected $type