public static function factory($user, $type, $definition, $eventHandler)
    {
        $classname = 'DataSift_StreamConsumer_' . $type;
        if (! class_exists($classname)) {
            throw new DataSift_Exception_InvalidData('Consumer type "' . $type . '" is unknown');
        }

        return new $classname($user, $definition, $eventHandler);
    }