We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,最近我们团队在做一些与责任链相关的coding,拜读了您的源码,深受启发,感谢!
DefaultKeyIdentificationChain.java在匹配对应的KeyIdentification时:
List<KeyIdentification> identifications = identifyMap.get(workflowId); if(identifyIndexMap.containsKey(workflowId)) { index = identifyIndexMap.get(workflowId) == null ? 0 : identifyIndexMap.get(workflowId); } else { index = 0; } if(index == identifications.size()) return IdentificationResultType.NO_MATCH; KeyIdentification keyIdentification = identifications.get(index); index ++; identifyIndexMap.put(workflowId,index); return keyIdentification.doIdentify(identifyCriterion,this);
当多个线程同时进行doIdentify()时,线程之间的index++是否会受到干扰?望指教!我们目前在这个地方使用ThreadLocal处理,是否有这个必要?
The text was updated successfully, but these errors were encountered:
您好,最近我们团队在做一些与责任链相关的coding,拜读了您的源码,深受启发,感谢! DefaultKeyIdentificationChain.java在匹配对应的KeyIdentification时: List<KeyIdentification> identifications = identifyMap.get(workflowId); if(identifyIndexMap.containsKey(workflowId)) { index = identifyIndexMap.get(workflowId) == null ? 0 : identifyIndexMap.get(workflowId); } else { index = 0; } if(index == identifications.size()) return IdentificationResultType.NO_MATCH; KeyIdentification keyIdentification = identifications.get(index); index ++; identifyIndexMap.put(workflowId,index); return keyIdentification.doIdentify(identifyCriterion,this); 当多个线程同时进行doIdentify()时,线程之间的index++是否会受到干扰?望指教!我们目前在这个地方使用ThreadLocal处理,是否有这个必要?
感谢支持,共同进步! 关于您提到的并发问题,由于我项目中并未有此场景,所以并未考虑并发问题,按我的理解,你加入TheadLocal也是可以的。不过也可以考虑使用Atomic包中的解决方案。
Sorry, something went wrong.
No branches or pull requests
您好,最近我们团队在做一些与责任链相关的coding,拜读了您的源码,深受启发,感谢!
DefaultKeyIdentificationChain.java在匹配对应的KeyIdentification时:
当多个线程同时进行doIdentify()时,线程之间的index++是否会受到干扰?望指教!我们目前在这个地方使用ThreadLocal处理,是否有这个必要?
The text was updated successfully, but these errors were encountered: