Microsoft Orleans — Reusing Grains and Grain State

Russell Hammett Jr. (Kritner)
7 min readOct 17, 2018

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:

--

--

Russell Hammett Jr. (Kritner)

Just a boring Application Developer/Dad. I enjoy gaming, learning new technologies, reading, and potentially other stuff. That’s about it.