Microsoft Orleans — Reusing Grains and Grain State

We’ve explored Orleans for distributing application logic across a cluster. Next, we’ll be looking at grain reuse and grain state…

Recap

Note the starting point of this code can be found here. As described previously, grains are the “primitives” that are created for use with Orleans code. You invoke grains in a very similar manner to your “normal” code to make it as simple as possible. In the previous example we simply called the grain a single time; it takes in a value, and spits it back: