Book Image

Mastering Dart

By : Sergey Akopkokhyants
Book Image

Mastering Dart

By: Sergey Akopkokhyants

Overview of this book

Table of Contents (19 chapters)
Mastering Dart
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


You now have a better understanding of event-driven architecture, which is one of the key concepts of Dart VM. Event-driven architecture is the right approach to build loosely coupled asynchronous systems.

Dart relies on event-driven architecture based on a single-threaded execution model with a single event loop and two queues. The event loop is backed by a single thread, so no synchronization or locks are required at all. When the event loop is blocked with an operation, this blocks the entire application. A combination of single-threaded execution models and asynchronous operations allows an application to be more productive and less resource intensive.

Future is a proxy for an initially unknown result that returns as a value instead of calling a callback function. Future almost always adds an event or microtask into the queue that is being processed in the event loop. Future can be completed with a value or error only once.

Zones implement the best practices of a configurable...