Commit 7e98e1f
authored
Separate channel creation and state probe, and error handling thereof. (#2465)
## Motivation
Currently the `Channel` object is calling into the `PersistentChannel`
internals to do things like provision an active channel and check state.
The division of where work and error handling is managed becomes muddied
in this situation, which complicates handling errors in ways that aren't
`unwrap`.
This was also motivated by work to implement the always-failing
PersistentChannel PR, but it seemed like it could be broken off into
it's own PR.
## Solution
Moving the actual mechanics into the `PersistentChannel` object, which
owns channel config, and allows `Channel` to be a lightweight handles
for users to interact with. Specifically state probing and channel
creation are now in `PersistentChannel`.
`PersistentChannel` calls are wrapped in `Result` objects that are
translated at the `Channel` level to the appropriate public-facing API
objects. `get_or_create_active_channel()` just becomes
`get_active_channel()` and passes the 'create' flag, which controls
whether a new channel is created if it does not already exist.
The external semantics should stay the same as they have been.
This does not yet address the error that can surface in `call()`,
because it's not yet clear what the error reporting story is.1 parent 54fab77 commit 7e98e1f
1 file changed
+43
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
158 | 159 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 160 | + | |
174 | 161 | | |
175 | 162 | | |
176 | 163 | | |
| |||
183 | 170 | | |
184 | 171 | | |
185 | 172 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | 173 | | |
199 | | - | |
| 174 | + | |
200 | 175 | | |
201 | 176 | | |
202 | 177 | | |
| |||
213 | 188 | | |
214 | 189 | | |
215 | 190 | | |
216 | | - | |
217 | | - | |
| 191 | + | |
| 192 | + | |
218 | 193 | | |
219 | 194 | | |
220 | 195 | | |
| |||
228 | 203 | | |
229 | 204 | | |
230 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
231 | 243 | | |
232 | 244 | | |
233 | 245 | | |
| |||
0 commit comments