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
Hands-On Azure Digital Twins

You're reading from   Hands-On Azure Digital Twins A practical guide to building distributed IoT solutions

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781801071383
Length 446 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexander Meijers Alexander Meijers
Author Profile Icon Alexander Meijers
Alexander Meijers
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Section 1: Azure Digital Twin Essentials
2. Chapter 1: About Digital Twins FREE CHAPTER 3. Chapter 2: Requirements and Installation 4. Section 2: Getting Started with Azure Digital Twins
5. Chapter 3: Digital Twin Definition Model 6. Chapter 4: Understanding Models 7. Chapter 5: Model Elements 8. Chapter 6: Creating Relationships between Azure Digital Twin Models 9. Chapter 7: Querying Digital Twins 10. Chapter 8: Building Models Using Ontologies 11. Section 3: Digital Twins Advanced Techniques
12. Chapter 9: APIs and SDKs 13. Chapter 10: Building a Digital Twin Pipeline 14. Chapter 11: Updating the Model 15. Chapter 12: Event Routing 16. Chapter 13: Setting up Azure Maps 17. Chapter 14: Integrating Azure Maps 18. Chapter 15: Monitoring and Troubleshooting 19. Section 4: Digital Twin Implementations in Real-world Scenarios
20. Chapter 16: Facility of the Future 21. Chapter 17: Creating Digital Twins for Smart Building 22. Chapter 18: Simulations Using a Digital Twin 23. Assessments 24. Other Books You May Enjoy

Querying asynchronous calls using code

The query calls of the Query API from Azure Digital Twins support paging. However, this requires another approach to be used in calling the methods. Until now, we have been calling methods synchronously. Since a call always depends on the availability of the service or the network connectivity, building production solutions requires using asynchronous calls.

Asynchronous calls also allow us to perform paging with the result of a query. Paging does immediately think about a fix number of results by page. In the case of executing queries, we talk more about handling each result from the query. The following example calls a method for each result in the query.

Open the DigitalTwinsManager class and add the following code inside the class definition, directly under the class properties:

public delegate void QueryResult(BasicDigitalTwin dt);

This code contains the definition of a delegate function. A delegate function describes the format...

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