Commit 5d21ad1
authored
feat(util): introduce
pr #140 introduced a new channel-backed body. this body provides a new
equivalent to the defunct `hyper::Body::channel()` interface that was
exposed in hyper 0.14, and removed in the 1.0 major release.
the previous `Sender` type also included a useful method,
`try_send_data()`, which allows a thread to _synchronously_ attempt to
send data _outside_ of an asynchronous context.
<https://docs.rs/hyper/0.14.31/hyper/body/struct.Sender.html#method.try_send_data>
this commit introduces a loosely equivalent `Sender::try_send()` method
to provide users of `http-body-util` with a means to send `Frame<T>`
values outside of an asynchronous context, without potentially
scheduling the caller to be woken later or yielding should the channel
be full.
this function accepts a `Frame<D>` rather than a chunk of data, to fit
in with the shift towards frame-oriented interfaces in `http-body` and
`http-body-util`.
Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>channel::Sender::try_send() (#146)1 parent 1090bff commit 5d21ad1
1 file changed
+66
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
97 | 117 | | |
98 | 118 | | |
99 | 119 | | |
| |||
193 | 213 | | |
194 | 214 | | |
195 | 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 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
196 | 262 | | |
197 | 263 | | |
198 | 264 | | |
| |||
0 commit comments