Commit e30f6e4
committed
Add
On some scenarios, it's useful to "pause" the `Loop` so that we stop
processing events for some reason (e.g. to stop a `Loop` backed
Service). Following the same reasoning, it becomes necessary to have a
"resume" mechanism so that the Loop starts processing events again.
Given `Loop` now starts automatically and `stop` is designed as a tear
down mechanism to be used on dealloc and dispose all observations, some
new API's are required so that we can unplug/replug feedbacks to
achieve the above mentioned pause/resume behavior.
## Changes
- Create new `unplugFeedbacks` and `replugFeedbacks` API's in
`Floodgate`, which disposes feedbacks observations and restores them,
respectively. Floodgate now retains the feedbacks passed in on
`bootstrap` to use them on `replugFeedbacks`.
- Add `pause` and `resume` API's to `LoopBoxBase`.
- Implement `pause` and `resume` API's in `RootLoopBox`, which unplug
and replug the feedbacks on the `Floodgate`, respectively.
- Implement `pause` and `resume` API's in `ScopedLoopBox`, which
forward the calls to their root, respectively.pause and resume API's to Loop
1 parent 49404fc commit e30f6e4
File tree
4 files changed
+50
-3
lines changed- Loop
- Public
4 files changed
+50
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
44 | 63 | | |
45 | 64 | | |
46 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
84 | 100 | | |
85 | 101 | | |
86 | 102 | | |
| |||
113 | 129 | | |
114 | 130 | | |
115 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
0 commit comments