2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-31 09:45:36 +00:00
Commit graph

634 commits

Author SHA1 Message Date
Yoshua Wuyts
9bf06ce52b fix io::copy link (#164)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-08 17:41:23 +02:00
Fedor Sakharov
55bdea4649
adds stream::filter_map combinator 2019-09-08 18:09:33 +03:00
bors[bot]
63f3a809aa
Merge #161
161: Split BufRead into multiple files r=stjepang a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
2019-09-08 14:27:43 +00:00
Yoshua Wuyts
ba43a05d01 split stream into multiple files (#150)
* split stream into multiple files

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

* cargo fmt

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-08 12:56:51 +02:00
Stjepan Glavina
55550c6fc9 Split BufRead into multiple files 2019-09-08 12:54:22 +02:00
Stjepan Glavina
8c00cc53ce Flush more often to prevent flushes during seek 2019-09-08 12:14:07 +02:00
bors[bot]
8d3d80a678
Merge #151
151: Split io into multiple files r=stjepang a=yoshuawuyts

Counterpart to #150, splits `io::read` and `io::write` into multiple files. This is useful to prevent a single file from becoming hard to navigate as we add more combinators. No other changes were made. Ref #131. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-08 09:57:36 +00:00
bors[bot]
a8a2ae9e29
Merge #157
157: More robust file implementation r=stjepang a=stjepang

This is a reimplementation of the `File`s state machine.

The previous implementation was simple and a bit naive. It was not fundamentally wrong but had surprises in some corner cases. For example, if an async read operation was started but we timed out on it, the file cursor would move even though we didn't complete the operation. The new implementation will move the cursor only when read/write operations complete successfully.

There was also a deadlock hazard in the case where multiple tasks were concurrently reading or writing to the same file, in which case some task wakeups would be lost. This PR fixes the problem.

A nice consequence of this PR: `futures-channel` is now unused, so we can remove it from the dependency list.

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
2019-09-08 08:44:17 +00:00
Stjepan Glavina
6ed0e857fd Fix some typos, expand comments 2019-09-08 10:43:47 +02:00
Yoshua Wuyts
ec1f33fe62
inline better
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-08 02:03:09 +02:00
Yoshua Wuyts
b1d85ab460
add io::prelude
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-08 01:55:39 +02:00
Stjepan Glavina
17c95a39d7
More robust file implementation
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-07 23:17:20 +02:00
Yoshua Wuyts
910801e2d6
fix doc compile
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-07 23:15:21 +02:00
Yoshua Wuyts
e1137345d4
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-07 23:15:21 +02:00
Yoshua Wuyts
4a2194f37c
split io::write into multiple files
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-07 23:15:21 +02:00
Yoshua Wuyts
a90100962d
split io::read into multiple files
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-07 23:15:21 +02:00
Fedor Sakharov
91a66c2d94
append doc example for io::buf_read::read_until 2019-09-06 21:58:53 +03:00
Florian Gilcher
481002ee71
Merge pull request #152 from montekki/fs-fix-buf-read-docs
fixes docs for io::buf_read::read_until
2019-09-06 17:20:43 +02:00
Fedor Sakharov
a2c2413bc5
fixes docs for io::buf_read::read_until 2019-09-06 17:45:24 +03:00
Fedor Sakharov
7e3599a6a5 add stream::min_by method (#146)
* add stream::min_by method

* Update src/stream/stream.rs

Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
2019-09-06 12:08:51 +02:00
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.
2019-09-06 10:36:25 +01:00
Stjepan Glavina
bac74c2d7f
Reduce dependency on futures crate (#140)
* Add future::poll_fn

* Replace all uses of poll_fn with the new one

* Remove some uses of futures

* Simplify ReadDir and DirEntry

* Remove some use of futures from File

* Use futures subcrates

* Fix imports in docs

* Remove futures-util dependency

* Remove futures-executor-preview

* Refactor

* Require more features in the futures-preview crate
2019-09-05 01:22:41 +02:00
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
2019-09-04 20:09:49 +02:00
Shady Khalifa
bff10fe83b Stream::any implementation (#135)
* add stream::any method

* use `ret` macro and small improvements

* fix docs return type in `ret` macro
2019-09-01 19:58:16 +02:00
James Munns
e99eafe64f
Merge pull request #132 from shekohex/stream-all-method
Stream::all implementation
2019-08-31 13:10:02 +02:00
Shady Khalifa
e517c60fb1
remove comments 2019-08-30 20:32:03 +02:00
Shady Khalifa
e8860454e7
remove extra newline
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
2019-08-30 20:30:48 +02:00
Stjepan Glavina
38a86766d3 Add future::timeout() (#20)
* Add future::timeout()

* Update src/future/timeout.rs

Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>

* Update src/future/timeout.rs

Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>

* Put futues::timeout behind unstable feature
2019-08-30 20:28:49 +02:00
Shady Khalifa
243a48c14e remove debug 2019-08-30 18:37:58 +02:00
Shady Khalifa
fe45ba5628 update docs and examples 2019-08-30 18:35:51 +02:00
Shady Khalifa
3b80165532 add stream::all method 2019-08-30 17:42:35 +02:00
Roman Proskuryakov
374f0c9eb8 Refactor TcpStream::connect into resolving loop and TcpStream::connect_to (#119) 2019-08-28 22:09:15 +02:00
Roman Proskuryakov
8dff8951a6 Reduce io::TimeoutFuture to futures_timer::TryFutureExt (#113) 2019-08-27 11:47:15 +02:00
Dylan Frankland
d47f7d3e92 rustfmt fs::create_dir_all 2019-08-26 12:59:30 -07:00
Dylan Frankland
c21e381098 Remove unused import from fs::create_dir_all 2019-08-26 12:50:06 -07:00
Dylan Frankland
8451789da5 Expose fs::create_dir_all 2019-08-26 12:47:15 -07:00
Florian Gilcher
70769d8bac
Merge pull request #94 from async-rs/remove-async_await-gate
remove async_await feature gate
2019-08-21 11:17:28 -07:00
Yoshua Wuyts
63ad786768
remove async_await feature gate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-08-21 00:29:35 -07:00
Kirill Mironov
a0759a6c53 Implement LineWriter and BufWriter 2019-08-21 01:44:05 +03:00
Kirill Mironov
48d4c9b18d begin implementing BufWriter 2019-08-20 18:30:33 +03:00
Kirill Mironov
91aeb39e4c begin implementing BufWriter 2019-08-20 14:48:15 +03:00
Aleksey Kladov
04cafeab2c fix counting lines example 2019-08-20 11:18:11 +03:00
Andrew Chin
50e69dc765 Fix documention links to docs.rs 2019-08-16 21:50:02 -04:00
Stjepan Glavina
6418bc9849 Fix failing docs 2019-08-16 17:39:49 +02:00
Stjepan Glavina
0647de5e8d Tweak docs 2019-08-16 17:18:39 +02:00
Stjepan Glavina
3c42ecab8f Prepare for v0.99.0 2019-08-16 17:02:17 +02:00
Stjepan Glavina
f4ff5443c8 Prepare for v0.99.0 2019-08-16 16:59:01 +02:00
Florian Gilcher
56cd64520d
Merge pull request #33 from async-rs/remove-time-module
Remove time module
2019-08-16 16:56:47 +02:00
Florian Gilcher
fa407b18c0 Http with io timeouts (#42)
* Add simple http example with a timeout

* Update lib.rs simple http example comment

* Move to current io module
2019-08-16 16:36:44 +02:00
Florian Gilcher
9ae2742955
Fix book link 2019-08-16 15:19:10 +02:00
Stjepan Glavina
4b45918f50 Remove time module 2019-08-15 19:26:10 +02:00
Stjepan Glavina
8c647cf5b4
Merge pull request #32 from async-rs/tyler_randomized_spindown
Stagger background thread spin-down to avoid a thundering herd
2019-08-15 19:13:43 +02:00
Stjepan Glavina
487811ed4c
Merge pull request #19 from async-rs/io-timeout
Add io::timeout()
2019-08-15 18:46:35 +02:00
Tyler Neely
10146e31f0 Stagger background thread spin-down to avoid a thundering herd 2019-08-15 18:18:13 +02:00
Stjepan Glavina
e3fc67c1cb Address comments 2019-08-15 17:59:48 +02:00
Florian Gilcher
228f22440c
Link to the book from lib.rs 2019-08-15 15:33:45 +02:00
Stjepan Glavina
9b3e8b8f26 Use our own Sink/Empty and fix compilation errors 2019-08-15 11:47:20 +02:00
Stjepan Glavina
ea2da1f4a4
Merge branch 'master' into tyler_elastic_threadpool 2019-08-15 10:52:52 +02:00
Stjepan Glavina
d512e7c45c Add io::timeout() 2019-08-14 16:14:44 +02:00
Stjepan Glavina
13835b0a78 Formatting 2019-08-14 15:57:51 +02:00
Stjepan Glavina
dd40887750 Formatting 2019-08-14 15:35:46 +02:00
Stjepan Glavina
e459bd048e Cleanup and docs 2019-08-14 04:22:37 +02:00
Stjepan Glavina
019c8085f4 Cleanup examples 2019-08-14 03:47:39 +02:00
Stjepan Glavina
a2e54fcd29 Replace crossbeam with crossbeam-channel 2019-08-12 23:47:32 +02:00
Stjepan Glavina
ae84fd4498
Merge branch 'master' into tyler_elastic_threadpool 2019-08-12 20:32:49 +02:00
Stjepan Glavina
1f9628d8ad Cleanup 2019-08-12 20:29:16 +02:00
Stjepan Glavina
01aac21386 Modularize time module 2019-08-12 20:28:50 +02:00
Stjepan Glavina
9d8ac36813 Rename feature docs.rs to docs 2019-08-12 19:50:30 +02:00
Stjepan Glavina
756da0e89d Modularize 2019-08-12 19:45:28 +02:00
Stjepan Glavina
c3eee6cba5 Fix broken docs 2019-08-12 19:12:41 +02:00
Stjepan Glavina
68d7a9c34e Refactor 2019-08-12 18:38:59 +02:00
Stjepan Glavina
a430e27819 Cleanup, docs, fmt 2019-08-12 18:00:21 +02:00
Stjepan Glavina
0ab2c8f49b typos 2019-08-12 12:54:37 +02:00
Stjepan Glavina
e44451a042 Revamp IO traits and Stream trait 2019-08-12 12:50:35 +02:00
Stjepan Glavina
43d822cbc5 Add a html logo 2019-08-12 12:50:35 +02:00
Tyler Neely
445b4161cb Improve comment on the blocking threadpool 2019-08-09 16:40:31 +02:00
Aleksey Kladov
3ce68814b6 implement FusedStream for net::Incoming 2019-08-09 12:47:48 +02:00
Tyler Neely
81fa1d419a Remove all of the dynamic control stuff for now and just use nonblocking sends + 1 second receive timeouts 2019-08-09 12:22:54 +02:00
Tyler Neely
ab613a53e5 Improve comments in the blocking threadpool 2019-08-09 12:06:43 +02:00
Tyler Neely
4cb1faf299 Use unbuffered work queue in the dynamic threadpool to reduce bufferbloat 2019-08-09 12:06:26 +02:00
Tyler Neely
d75aae23cb Tune timings of dynamic threadpool 2019-08-09 12:06:00 +02:00
Stjepan Glavina
3f4a56abdc Reformat doc examples 2019-08-09 02:56:59 +02:00
Tyler Neely
e97dfdc4cc Add dynamic threadpool 2019-08-08 16:48:18 +02:00
Florian Gilcher
5b0a6269a9
Initial commit 2019-08-08 14:44:48 +02:00