gpt4 book ai didi

perl - perl 中来自 redis 的非阻塞 blpop

转载 作者:可可西里 更新时间:2023-11-01 11:42:44 25 4
gpt4 key购买 nike

我有一个连续循环运行的程序

Pick one job from a Redis using BLPOP
Process the job,
LOOP

我需要做的是当工作正在进行时获得下一份工作,这样我就可以节省用于 redis blpop 的时间。我该怎么做

最佳答案

像这样:

do forever
BLPOP next job # from Redis
wait # for all background jobs to finish
process job & # process job in the background
done

关于perl - perl 中来自 redis 的非阻塞 blpop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22779276/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com