Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microservices with Azure

You're reading from   Microservices with Azure Build highly maintainable and scalable enterprise-grade apps

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787121140
Length 360 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Namit Tanasseri Namit Tanasseri
Author Profile Icon Namit Tanasseri
Namit Tanasseri
Rahul Rai Rahul Rai
Author Profile Icon Rahul Rai
Rahul Rai
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Microservices – Getting to Know the Buzzword 2. Microsoft Azure Platform and Services Primer FREE CHAPTER 3. Understanding Azure Service Fabric 4. Hands-on with Service Fabric – Guest Executables 5. Hands on with Service Fabric – Reliable Services 6. Reliable Actors 7. Microservices Architecture Patterns Motivation 8. Microservices Architectural Patterns 9. Securing and Managing Your Microservices 10. Diagnostics and Monitoring 11. Continuous Integration and Continuous Deployment 12. Serverless Microservices

Saving state

Actors generally need to persist their internal state so that they can recover it in case an Actor is started or restarted, in case of node crashes, or migrated across nodes in cluster. State persistence is also necessary to build complex Actor workflows that transform and enrich input data and generate resultant data that helps make decisions to carry out further operations.

For example, for an automobile system, a fuel Actor may persist the fuel consumption in its state to later calculate the mileage of the vehicle, which may later help decide whether the vehicle requires a maintenance check.

The Actor base class contains the read only StateManager property that can be used to operate with state data. The following lines of code, can save and retrieve state data where the argument cancellationToken is an object of type CancellationToken:

    //  Save state data...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime