Commit Graph

55 Commits (master)

Author SHA1 Message Date
Yoshua Wuyts c82b1efb69
fix(stream): add send guards on collect
Closes #639 

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
5 years ago
dignifiedquire 8f17e9275b test: try to stabilize CI 5 years ago
Friedel Ziegelmayer 5d55fa7a47
Merge pull request #701 from olegnn/flat_map_fixed 5 years ago
Afirez 9fa3ce3fd6 Add UdpSocket::PeerAddr #307 5 years ago
Oleg Nosov df22d87d09
Removed unnecessary links + hotfix 5 years ago
Oleg Nosov 924e5a3f41
Merge remote-tracking branch 'origin/master' into flat_map_fixed 5 years ago
Friedel Ziegelmayer e12cf80ab0
fix: allow for recursive block-on calls
Fixes #798,#795,#760
5 years ago
Friedel Ziegelmayer 2b6c7fedff
Merge pull request #772 from jbr/unixstream-clone 5 years ago
Azriel Hoh baead51a28 Reduces duration in timeout test.
Tries to get CI to pass.
5 years ago
Jacob Rothstein cd5e17fe87
make UnixStream Clone 5 years ago
Friedel Ziegelmayer e4c4c93d29
Test and fix 32 bit targets 5 years ago
dignifiedquire 1214bc2dee increase timeouts 5 years ago
dignifiedquire e4df1405c1 feat: add basic wasm support 5 years ago
dignifiedquire fd6ae40817 add timeout stress test 5 years ago
dignifiedquire 1308fbdf55 switch to smol instead of an internal runtime 5 years ago
Thayne McCombs db438abb8f
Implement async_std::sync::Condvar (#369)
* Implement async_std::sync::Condvar

Part of #217

* More rigourous detection of notification for condvar

* Use state of Waker instead of AtomicUsize to keep track of if task was
notified.

* Add test for notify_all

* Implement wait_timeout_until

And add warnings about spurious wakeups to wait and wait_timeout

* Use WakerSet for Condvar

This should also address concerns about spurious wakeups.

* Add test for wait_timeout with no lock held

* Add comments describing AwaitNotify struct

And remove an unnneded comment in a Debug implementation
5 years ago
Yoshua Wuyts 19fd7a4084 fix channel tests
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
nasa cc19592f80
Revert "Stabilize most stream method and remove unnecessary macros" 5 years ago
k-nasa f33d7f40ab fix test 5 years ago
k-nasa ec4b09ecd0 fix test code 5 years ago
Oleg Nosov 68063adddf
Add link to tests 5 years ago
Oleg Nosov 32068942a6
Fixed `flatten` 5 years ago
Oleg Nosov 85c32ef9d2
Use `assert` without `if`-clause 5 years ago
Oleg Nosov b68be72763
Use `assert` instead of `panic` 5 years ago
Oleg Nosov c80915e216
Dont spawn thread in tests 5 years ago
Oleg Nosov 303ac90b7c
Fixed `flat_map` 5 years ago
Stjepan Glavina 1d875836a2
Implement Clone for TcpStream (#689)
* Implement Clone for TcpStream

* Update examples

* Remove accidentally added examples
5 years ago
k-nasa 44e38eae59 fix open_file test code 5 years ago
Pascal Hertleif 56538ebd91 Improve verbose errors for socket addresses
Moves the point of adding error context to the net::addr module so that
we have access to the raw address input and can include it in the error
message.
5 years ago
Pascal Hertleif e01f07d72a Add context to more errors
cc #569
5 years ago
Pascal Hertleif c704643296 Remove verbose-errors cargo feature 5 years ago
Pascal Hertleif 8ce3e78952 verbose errors feature
This adds a new "verbose-errors" feature flag to async-std that enables
wrapping certain errors in structures with more context. As an example,
we use it in `fs::File::{open,create}` to add the given path to the
error message (something that is lacking in std to annoyance of many).
5 years ago
Stjepan Glavina bc24503382
Fix deadlock when all receivers are dropped (#474)
* Fix deadlock when all receivers are dropped

* Add a comment to explain the behavior of try_send

* Disable clippy
5 years ago
Aleksey Kladov fa91d7f856 Stream::merge does not end prematurely if one stream is delayed (#437)
* Stream::merge does not end prematurely if one stream is delayed

* `cargo test` without features works

* Stream::merge works correctly for unfused streams
5 years ago
Yoshua Wuyts c413e717da
Merge pull request #429 from markhildreth/tcp_smoke_tests
Added TCP smoke tests against std Listener and Stream
5 years ago
Stjepan Glavina 3dd59d7056
Refactor the task module (#421)
* Refactor the task module

* Fix clippy warning

* Simplify task-local entries

* Reduce the amount of future wrapping

* Cleanup

* Simplify stealing
5 years ago
Mark Hildreth c6c2bfa456 Added TCP smoke tests against std Listener and Stream 5 years ago
k-nasa 7fe2a1bbce fix clippy::cognitive_complexity 5 years ago
k-nasa c9d958d309 $cargo fix -Z unstable-options --clippy --features unstable 5 years ago
Stjepan Glavina b2fe91385b
Add channel behind unstable feature flag (#380)
* Add channel behind unstable feature flag

* Don't check tests without unstable feature flag

* Fix typos

* Remove useless attribute
5 years ago
Taiki Endo e405544ea0
Enable tests on CI (#357)
* Enable tests on CI

* Fix failed test
5 years ago
k-nasa ad156b1fce feat: Add BufWriter::into_inner flush 5 years ago
Stjepan Glavina da2335bd57 Cleanup BufWriter 5 years ago
Miloš Vučenović c3e38150e4 Fix uds listener hanging on accept (#272)
* Fix uds listener hanging on accept

UDS listener was hanging because the accept method would return
`Poll::Pending` without registering the task to be awoken in the case
when underlying unix listener returns a WouldBlock that gets converted
to None. This is a hacky fix for this case.

Should fix #248

* Test simulating uds ping-pong server/client

This one should reproduce #248 bug to prevent further regressions.

* Code review fixes
5 years ago
Yoshua Wuyts 0b39306b74
fix barrier tests
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
dignifiedquire b77b72d333 feat: implement sync::Barrier
Based on the implementation in https://github.com/tokio-rs/tokio/pull/1571
5 years ago
Yuxuan Shui 876059cfe0
Make sure ownership is transferred in into_raw_fd
Previously all of the into_raw_fd implementations only returns a copy of
the inner RawFd, while still holding the ownership of the file
descriptor when returning for into_raw_fd. Since `self` is dropped at
the end of into_raw_fd, the returned file descriptor will actually be
closed, render the function unuseable.

The patch makes sure that into_raw_fd actually takes the ownership of
the file descriptor all the way from the inner IoHandle. To achieve
this, I have to use an Option in IoHandle to store the I/O source. It's
not pretty, but I cannot come up with a better way.
5 years ago
Yuxuan Shui 2ca9c46b4b
Add tests for UnixDatagram from_raw_fd/into_raw_fd 5 years ago
DCjanus 238a3c882b Implement an async version of ToSocketAddrs (#74)
* Implement an async version of ToSocketAddrs

* fix documentation issue

* genius hack: pretending to be `impl Future`

* replace `std::net::ToSocketAddrs` with `async-std::net::ToSocketAddrs`

* Move unit tests into the tests directory

* Stylistic changes

* Remove re-exports in async_std::net

* fix broken link

* some mirror changes

* remove unnecessary format

* migrate: `std::net::ToSocketAddrs` -> `async_std::net::ToSocketAddrs`

* fix typo(tutorial)

* remove unnecessary type bound

* lifetime for future
5 years ago
Roman Proskuryakov b95dd13d3b add tests for io::timeout 5 years ago