feat(body): change Sender::send_data to an async fn.

The previous version is renamed to `try_send_data`.

BREAKING CHANGE: Usage of `send_data` should either be changed to
  async/await or use `try_send_data`.
This commit is contained in:
Sean McArthur
2019-08-30 14:50:37 -07:00
parent 0331219b40
commit 62a96c077b
4 changed files with 20 additions and 11 deletions

View File

@@ -1748,7 +1748,7 @@ mod conn {
let (mut sender, body) = Body::channel();
let sender = thread::spawn(move || {
sender.send_data("hello".into()).ok().unwrap();
sender.try_send_data("hello".into()).expect("try_send_data");
Runtime::new().unwrap().block_on(rx).unwrap();
sender.abort();
});