/** * Each message in the user stream is just ready to go. * * @param array $data */ function routeMessage(stdClass $data) { $context = array('source' => 'userstream'); parent::handleMessage($data, $context); }
/** * Each message in the site stream tells us which user ID it should be * routed to; we'll need that to let the caller know what to do. * * @param array $data */ function routeMessage(stdClass $data) { $context = array('source' => 'sitestream', 'for_user' => $data->for_user); parent::handleMessage($data->message, $context); }
/** * Set up event handlers on the streaming interface. * * @fixme add more event types as we add handling for them */ protected function setupEvents(TwitterStreamReader $stream) { $handlers = array('status'); foreach ($handlers as $event) { $stream->hookEvent($event, array($this, 'onTwitter' . ucfirst($event))); } }