Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net core StackExchange.Redis LPop是否处于发布/订阅的潜在竞争状态?_.net Core_Redis_Stackexchange.redis - Fatal编程技术网

.net core StackExchange.Redis LPop是否处于发布/订阅的潜在竞争状态?

.net core StackExchange.Redis LPop是否处于发布/订阅的潜在竞争状态?,.net-core,redis,stackexchange.redis,.net Core,Redis,Stackexchange.redis,在使用dotnetcore中的StackExchange.Redis库时,我考虑使用pub/sub功能来实现阻止某些工作类使用消息,如前所述 给出的示例如下: sub.Subscribe(channel, delegate { string work = db.ListRightPop(key); if (work != null) Process(work); }); //... db.ListLeftPush(key, newWork, flags: CommandF

在使用dotnetcore中的StackExchange.Redis库时,我考虑使用pub/sub功能来实现阻止某些工作类使用消息,如前所述

给出的示例如下:

    sub.Subscribe(channel, delegate {
    string work = db.ListRightPop(key);
    if (work != null) Process(work);
});
//...
db.ListLeftPush(key, newWork, flags: CommandFlags.FireAndForget);
sub.Publish(channel, "");
如果多个工作者订阅
频道
(在分布式系统中,而不是在同一台主机上),那么
ListRightPop
是否仍然存在潜在竞争条件,因为它不是Redis群集上的阻塞操作