| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Package coordinator implements a minimal interface to the Coordinator service |
| 6 // that is sufficient for Collector usage. |
| 7 // |
| 8 // The interface also serves as an API abstraction boundary between the current |
| 9 // Coordinator service definition and the Collector's logic. |
| 10 // |
| 11 // Cache |
| 12 // |
| 13 // Coordinator methods are called very heavily during Collector operation. In |
| 14 // production, the Coordinator instance should be wrapped in a Cache structure |
| 15 // to locally cache Coordinator's known state. |
| 16 // |
| 17 // The cache is responsible for two things: Firstly, it coalesces multiple |
| 18 // pending requests for the same stream state into a single Coordinator request. |
| 19 // Secondly, it maintains a cache of completed responses to short-circuit the |
| 20 // Coordinator. |
| 21 // |
| 22 // Stream state is stored internally as a Promise. This Promise is evaluated by |
| 23 // querying the Coordinator. This interface is hidden to callers. |
| 24 package coordinator |
| OLD | NEW |