Redis批量快速导入

$redis = new Redis();
$pipe = $redis->multi(Redis::PIPELINE);
while(true){
    //code...
    $pipe->sAdd($key, $value);
}
try{
    $pipe->exec();
}catch (Exception $e){
    $pipe->discard();
}

你可能感兴趣的:(Redis批量快速导入)