在Azure Service Fabric自动过期可靠的字典对象状态服务 [英] Auto expire reliable dictionary objects in Azure Service Fabric Stateful services
问题描述
是否有任何内置方式在可靠的字典对象上设置到期时间到期后过期?尝试看看我们是否可以开始使用可靠的集合来存储用户会话对象。
Is there any inbuilt way to set an expire time on the reliable dictionary object to expire after a certain time? Trying to see if we can start using reliable collections to store user session objects.
无状态服务可以访问由状态服务创建的字典对象吗?
Can a stateless service access the dictionary objects created by a stateful service?
对不起,如果这些是跛脚的问题。试图理解这些概念。
Sorry if these are lame questions. Trying to understand the concepts.
谢谢!
推荐答案
没有内置的到期。您当然可以使用集合来存储用户会话对象,但是您必须自行清理过期会话。
No, there is no built-in expiration. You can certainly use collections to store user session objects but you'll have to do a sweep to clean-up expired sessions yourself.
否,无状态服务无法访问字典对象直接拥有该字典的有状态服务必须公开一些其他服务的API方法来调用,这是一个很好的模式。
No, stateless services can't access dictionary objects directly. The stateful service that owns the dictionary has to expose some API methods for other services to call, which is a good pattern to follow anyway.
不,不是跛脚的问题!
这篇关于在Azure Service Fabric自动过期可靠的字典对象状态服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!