Transition to half-closed (local) state.
(self)
| 267 | self.priority_exclusive = exclusive |
| 268 | |
| 269 | def _half_close_local(self): |
| 270 | """Transition to half-closed (local) state.""" |
| 271 | if self.state == StreamState.OPEN: |
| 272 | self.state = StreamState.HALF_CLOSED_LOCAL |
| 273 | elif self.state == StreamState.HALF_CLOSED_REMOTE: |
| 274 | self.state = StreamState.CLOSED |
| 275 | else: |
| 276 | raise HTTP2StreamError( |
| 277 | self.stream_id, |
| 278 | f"Cannot half-close local in state {self.state.name}" |
| 279 | ) |
| 280 | |
| 281 | def _half_close_remote(self): |
| 282 | """Transition to half-closed (remote) state.""" |