Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

一个消息队列中等待另一个消息队列,使用sleep,偶尔会导致崩溃

$is_finish = $redis->sIsMember("time_machine_key", '111');

while ($is_finish) {
 print("等2秒");
 sleep(2);
 $is_finish = $redis->sIsMember("time_machine_key", '111');
}
sleep(2);

使用$is_finish来判断另一条消息队列是否完成,若完成才能完成本条消息队列。

,使用sleep来延迟,偶尔会导致崩溃,使用的redis来作为消息队列,会导致本条消息队列退出,应该如何处理呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你指的崩溃是啥意思?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...