* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @author Aaron Schulz
*/
use Psr\Log\LoggerInterface;
/** @var string Compression method to use */
protected $compression;
+ const MAX_PUSH_SIZE = 25; // avoid tying up the server
+
/**
* @param array $params Possible keys:
* - redisConfig : An array of parameters to RedisConnectionPool::__construct().
parent::__construct( $params );
$params['redisConfig']['serializer'] = 'none'; // make it easy to use Lua
$this->server = $params['redisServer'];
- $this->compression = isset( $params['compression'] ) ? $params['compression'] : 'none';
+ $this->compression = $params['compression'] ?? 'none';
$this->redisPool = RedisConnectionPool::singleton( $params['redisConfig'] );
if ( empty( $params['daemonized'] ) ) {
throw new InvalidArgumentException(
if ( $flags & self::QOS_ATOMIC ) {
$batches = [ $items ]; // all or nothing
} else {
- $batches = array_chunk( $items, 100 ); // avoid tying up the server
+ $batches = array_chunk( $items, self::MAX_PUSH_SIZE );
}
$failed = 0;
$pushed = 0;