PHP Interface DataSift_IStreamConsumerEventHandler

Author: Stuart Dallas ([email protected])
Show file Open project: datasift/datasift-php

Public Methods

Method Description
onConnect ( DataSift_StreamConsumer $consumer ) : void Called when the stream is connected.
onDeleted ( DataSift_StreamConsumer $consumer, array $interaction, string $hash ) : void Called for each deletion notification consumed.
onDisconnect ( DataSift_StreamConsumer $consumer ) : void Called when the stream is disconnected.
onError ( $consumer, string $message ) : void Called when an error occurs or is received down the stream.
onInteraction ( DataSift_StreamConsumer $consumer, array $interaction, string $hash ) : void Called for each interaction consumed.
onStatus ( DataSift_StreamConsumer $consumer, string $type, array $info ) : void Called for each status message received.
onStopped ( $consumer, string $reason ) : void Called when the consumer stops for some reason.
onWarning ( DataSift_StreamConsumer $consumer, string $message ) : void Called when a warning occurs or is received down the stream.

Method Details

onConnect() public method

Called when the stream is connected.
public onConnect ( DataSift_StreamConsumer $consumer ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
return void

onDeleted() public method

Called for each deletion notification consumed.
public onDeleted ( DataSift_StreamConsumer $consumer, array $interaction, string $hash ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
$interaction array The interaction data.
$hash string The hash of the stream that matched this interaction.
return void

onDisconnect() public method

Called when the stream is disconnected.
public onDisconnect ( DataSift_StreamConsumer $consumer ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
return void

onError() public method

Called when an error occurs or is received down the stream.
public onError ( $consumer, string $message ) : void
$message string The error message.
return void

onInteraction() public method

Called for each interaction consumed.
public onInteraction ( DataSift_StreamConsumer $consumer, array $interaction, string $hash ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
$interaction array The interaction data.
$hash string The hash of the stream that matched this interaction.
return void

onStatus() public method

Called for each status message received.
public onStatus ( DataSift_StreamConsumer $consumer, string $type, array $info ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
$type string The status type.
$info array The data sent with the status message.
return void

onStopped() public method

Called when the consumer stops for some reason.
public onStopped ( $consumer, string $reason ) : void
$reason string The reason the consumer stopped.
return void

onWarning() public method

Called when a warning occurs or is received down the stream.
public onWarning ( DataSift_StreamConsumer $consumer, string $message ) : void
$consumer DataSift_StreamConsumer The consumer sending the event.
$message string The warning message.
return void