OLD | NEW |
1 # Prefetching Offline Pages: development guidelines | 1 # Prefetching Offline Pages |
2 | 2 |
3 * Implementations that are injected dependencies should always provide | 3 ## Architecture overview |
4 lightweight construction and postpone heavier initialization (i.e. DB | 4 |
| 5 ### PrefetchService |
| 6 |
| 7 Is the ownership holder for the main components of the prefetching system and |
| 8 controls their lifetime. |
| 9 |
| 10 ### PrefetchDispatcher |
| 11 |
| 12 Manages the prefetching pipeline tasks. It receives signals from external |
| 13 clients and creates the appropriate tasks to execute them. It _might_ at some |
| 14 point execute advanced task management operations like canceling queued tasks or |
| 15 changing their order of execution. |
| 16 |
| 17 ### \*Task(s) (i.e. AddUniqueUrlsTask) |
| 18 |
| 19 They are the main wrapper of pipeline steps and interact with different |
| 20 abstracted components (Downloads, persistent store, GCM, etc) to execute them. |
| 21 They implement TaskQueue's Task API so that they can be exclusively executed. |
| 22 |
| 23 ## Development guidelines |
| 24 |
| 25 * Implementations that are injected dependencies during service creation should |
| 26 have lightweight construction and postpone heavier initialization (i.e. DB |
5 connection) to a later moment. Lazy initialization upon first actual usage is | 27 connection) to a later moment. Lazy initialization upon first actual usage is |
6 recommended. | 28 recommended. |
OLD | NEW |