对Geode本机客户端AttributesMutator.SetCacheListener

问题描述

如果我在UI上有一个注册侦听器的按钮,则不同步,然后单击几次,然后在某个区域反复设置侦听器挂起:

Cache c已被初始化。这是使用C#Geode Native Client。

IRegion<string,Object> d = c.GetRegion<string,Object>("deal");

try
{
    Logs.Trace("Registering key");
    d.GetSubscriptionService().RegisterKeys(s);
    d.AttributesMutator.SetCacheListener(new LDeal<string,Object>(c,AddDeal));
}
catch (Exception ex)
{
    new ApplicationException("Can't register key: " + clOrdId,ex);
}

这是在区域上设置侦听器的最佳方法吗?如果要挂起,如何设置超时时间,以便更好地管理侦听器?

更新:使用async / await可以解决此问题,因此SetCacheListener变为

await Task.Run(() => d.AttributesMutator.SetCacheListener(new LDeal<string,AddDeal)));

除了稍后取消注册侦听器

await Task.Run(() => r.GetSubscriptionService().UnregisterKeys(s));

总是给出静音错误(显然没有影响)

Apache.Geode.Client.IllegalStateException: : illegal State ---> 
Apache.Geode.Client.GeodeException:  0# 0x00007FF844136B85 in Apache_Geode
 1# 0x00007FF844136C5D in Apache_Geode
 2# 0x00007FF8441CCC1E in Apache_Geode
 3# 0x00007FF84424EB41 in Apache_Geode
 4# 0x00007FF8441E5557 in Apache_Geode
 5# 0x00007FF85FCA87E

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...