gpt4 book ai didi

azure - 在 OnOpenAsync 方法中调用 GetOrAddAsync

转载 作者:行者123 更新时间:2023-12-03 00:42:21 24 4
gpt4 key购买 nike

我使用StatefulServiceIReliableDictionary .

目前,我调用StateManager.GetOrAddAsync<IReliableDictionary>我到处都需要这本词典。

最好的做法是只调用一次 StateManager.GetOrAddAsync<IReliableDictionary>OnOpenAsync方法StatefulService并将返回值存储在成员中?

最佳答案

这并不重要。 I've asked it给产品团队得到了这样的回复:

You can cache the result of GetOrAddAsync locally but it doesn't matter since the statemanager does that for you automatically. Some folks think it's easier to keep a local, but I never do because now you have some lifecycle things to deal with (you have a ref to the thing not protected by state manger acquisition locks so you can see some different exceptions, but nothing you wouldn't have to deal with anyway).

我插入的斜体文本。

关于azure - 在 OnOpenAsync 方法中调用 GetOrAddAsync,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53882586/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com