You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to add to the Client interface the ability to batch queue jobs. In our case we need to batch queue around 40-100k jobs and it would be nice to do it in a single pipeline w/ Jedis.
voidenqueue(Stringqueue, List<Job> jobs); // Or Job...
The text was updated successfully, but these errors were encountered:
public static void doBulkEnqueue(Jedis jedis, String namespace, String queue, List<String> jobJsonList, int batchSize) {
jedis.sadd(JesqueUtils.createKey(namespace, new String[]{"queues"}), new String[]{queue});
Pipeline pipeline = jedis.pipelined();
String key = JesqueUtils.createKey(namespace, new String[]{"queue", queue});
int i = 0;
for (String jobJson : jobJsonList) {
String jobJson = it.next();
jedis.rpush(key, new String[]{jobJson});
++i;
if (i == batchSize) {
pipeline.sync();
pipeline = jedis.pipelined();
i = 0;
}
}
if (i > 0) {
pipeline.sync();
}
}
It would be nice to add to the
Client
interface the ability to batch queue jobs. In our case we need to batch queue around 40-100k jobs and it would be nice to do it in a single pipeline w/ Jedis.The text was updated successfully, but these errors were encountered: