2

If I have a grain (or a client) that is going to send messages to another grain often (several times per minute for hours on end), what is the best practice for accessing that grain? Do I get it from the factory, use it, and discard it - getting a new grain reference every time? Or in this case should I "hold" a reference to the grain, only getting it from the factory once?

4

1 回答 1

6

You can use the Factory. Getting the grain reference from a factory is a completely local operation and the references are also cached internally, so there is no need to hold and reuse them and you can simply get one from the factory every time you need one.

于 2017-04-28T06:08:09.327 回答