Commit graph

974 commits

Author SHA1 Message Date
Razican
f6829859fe
Fixed deduplication of code 2019-11-18 16:39:21 +01:00
hhggit
2c9b558d14 add os::windows::symlink_{dir,file} 2019-11-18 10:20:07 +08:00
Pascal Hertleif
99ddfb3f93 Wrap code more clearly in cfg blocks 2019-11-17 23:11:11 +01:00
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).
2019-11-17 21:54:44 +01:00
yjhmelody
223fcc30ee fix code style for stream 2019-11-17 00:35:56 +08:00
k-nasa
76975a4441 Merge branch 'master' into fix_clippy 2019-11-16 02:41:39 +09:00
Yoshua Wuyts
355e2eded8
Merge pull request #547 from async-rs/unpin-successors-test
remove pin_mut from successors test
2019-11-15 18:24:58 +01:00
Yoshua Wuyts
ee23ba6e94
Merge pull request #545 from yjhmelody/stream-partition-patch
use `as_mut` for stream-partition
2019-11-15 18:08:51 +01:00
Yoshua Wuyts
d68dc659b2
remove pin_mut from successors test
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-15 18:08:00 +01:00
Yoshua Wuyts
b5c3fb8bb5
Merge pull request #363 from felipesere/async-successors
Async successors
2019-11-15 18:04:10 +01:00
k-nasa
7d616c695d refactor: change to as_mut 2019-11-16 01:58:45 +09:00
yjhmelody
a69b3a8a9e use as_mut for stream-partition 2019-11-16 00:54:50 +08:00
k-nasa
a05b6a3810 fix: mutable ref 2019-11-16 01:36:53 +09:00
k-nasa
6cbf48f12d fix clippy warn 2019-11-16 01:29:16 +09:00
k-nasa
91ee4c7b9f doc: Add stream unzip doc 2019-11-16 01:16:48 +09:00
k-nasa
603b3c5085 add: Add stream unzip 2019-11-16 01:16:35 +09:00
Yoshua Wuyts
693a7257b8
Merge pull request #538 from k-nasa/stream_by_ref
Add stream by_ref
2019-11-15 17:14:17 +01:00
k-nasa
df92c63337 fix: Add unstable features 2019-11-16 00:29:54 +09:00
k-nasa
31cf932d80 wip: Add stream unzip 2019-11-16 00:24:59 +09:00
Yoshua Wuyts
3c6d41ccb4
Merge pull request #541 from yjhmelody/stream-partition
add stream-partition
2019-11-15 14:27:42 +01:00
yjh
74caed2d4b
Update src/io/seek/mod.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-11-15 18:22:06 +08:00
yjhmelody
76ec9c4563 update doc url 2019-11-15 14:33:34 +08:00
yjhmelody
d76b32e6d4 make it unstable and fix trait bound 2019-11-15 14:23:34 +08:00
yjhmelody
11268a80fb add stream-partition 2019-11-15 12:28:03 +08:00
Yoshua Wuyts
c4ba11ff95
Merge pull request #535 from async-rs/docs-sender-recv
backlink channel types
2019-11-15 03:35:43 +01:00
k-nasa
de67bf0fd4 feat: Add stream by_ref 2019-11-15 11:17:39 +09:00
Yoshua Wuyts
30ff7b09b6
mark Stream::count as unstable
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-14 22:45:46 +01:00
Yoshua Wuyts
c58747b5fc
Merge pull request #368 from starsheriff/stream_count
add stream::count
2019-11-14 22:40:45 +01:00
Yoshua Wuyts
31f129ebe7
backlink channel types
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-14 22:37:04 +01:00
Felipe Sere
64216b8e6b Take a normal closure, not an async one 2019-11-14 21:49:24 +01:00
Felipe Sere
786a52a09d Slight miss-merge 2019-11-14 21:37:51 +01:00
Felipe Sere
f14b37ff17 Remoe the T: Copy bound on the item 2019-11-14 21:35:38 +01:00
Felipe Sere
7677e9a3df Make the closure take a borrow to the value 2019-11-14 21:35:38 +01:00
Felipe Sere
bfb42b432e Rearrange docs to match 'repeat' 2019-11-14 21:35:38 +01:00
Felipe Sere
4c09cdbeac Mark successors as unstable 2019-11-14 21:35:38 +01:00
Felipe Sere
243cdd7ff1 Slight miss-merge 2019-11-14 21:35:19 +01:00
Felipe Sere
a257b7018c Rename some variables to match iter 2019-11-14 21:35:19 +01:00
Felipe Sere
af928163e4 Got further! Thx Josh! 2019-11-14 21:35:19 +01:00
Felipe Sere
8d97e0f974 Only produes empty value if next is ever a 'None' 2019-11-14 21:35:19 +01:00
Felipe Sere
266754897e Rename the module to 'successors' 2019-11-14 21:35:19 +01:00
Felipe Sere
554d5cfbc1 Slight renamings 2019-11-14 21:34:57 +01:00
Felipe Sere
8b662b659d Run rustfmt 2019-11-14 21:34:19 +01:00
Felipe Sere
95a3e53fcd Only use the Option of the future to decide to construct a new one 2019-11-14 21:33:45 +01:00
Felipe Sere
02b261de10 It compiles! Store the future and poll it instead of creating multiple new ones 2019-11-14 21:33:45 +01:00
Felipe Sere
fe3c9ef626 First attempt at successor 2019-11-14 21:33:45 +01:00
Yoshua Wuyts
4e1d79adb1
Merge pull request #524 from yjhmelody/stream-max
Add Stream max
2019-11-14 21:28:36 +01:00
Yoshua Wuyts
338273eb18
Merge pull request #356 from Wassasin/342-stream-throttle
Implemented StreamExt::throttle
2019-11-14 21:25:34 +01:00
Wouter Geraedts
dda65cbff0 Start throttle measurement before initialisation 2019-11-14 11:29:49 +01:00
Johannes Weissmann
9ebe41f2d6
Update src/stream/stream/mod.rs
Co-Authored-By: nasa <htilcs1115@gmail.com>
2019-11-14 10:34:09 +01:00
Wouter Geraedts
90c67c223a Decreased throttle test time to original values; only test lower bound 2019-11-14 10:26:56 +01:00
Stjepan Glavina
0c2282ffdc
Optimization: a slot for the next task to run (#529)
* Optimization: a slot for the next task to run

* Only notify workers when a task is pushed into a queue
2019-11-13 20:32:37 +01:00
yjhmelody
5adb112a00 export IntoInnerError for io 2019-11-13 13:52:16 +08:00
yjhmelody
9d634cb2a7 refactor io dir to be same with std 2019-11-13 12:42:59 +08:00
yjhmelody
879af6dc85 Add Stream max 2019-11-13 10:50:09 +08:00
Yoshua Wuyts
2dfdc1c482
polish lib.rs examples
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-12 23:10:23 +01:00
Grzegorz Gierlach
e442eba625 Cleaning up stream pinning. 2019-11-12 19:51:58 +01:00
Grzegorz Gierlach
f0875d2dca Cleaning up stream pinning. 2019-11-12 19:34:08 +01:00
Devashish Dixit
f611ceccc8 Run cargo fmt for doc comments (#515) 2019-11-12 17:47:03 +01:00
Wouter Geraedts
c5b3a98e5b Increased throttle test to 10x time 2019-11-12 16:22:25 +01:00
Wouter Geraedts
4ab7b213de Updated example to be consistent; added timing measurements to throttle 2019-11-12 15:38:02 +01:00
Wouter Geraedts
6990c1403f Reimplemented throttle to never drop Delay, added boolean flag 2019-11-12 15:07:20 +01:00
Wouter Geraedts
77a1849303 Merge branch '342-stream-throttle' of github.com:Wassasin/async-std into 342-stream-throttle 2019-11-12 15:03:54 +01:00
Wouter Geraedts
a722de1a10 Merge remote-tracking branch 'upstream/master' into 342-stream-throttle 2019-11-12 14:51:24 +01:00
Wouter Geraedts
88cbf2c119 Change throttle test to run in milliseconds 2019-11-12 14:51:11 +01:00
Wouter Geraedts
6f6d5e9d20
Updated throttle fn comments.
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
2019-11-12 14:35:03 +01:00
Wouter Geraedts
7c7386735e
Wrap around throttle comment
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
2019-11-12 14:34:31 +01:00
Yoshua Wuyts
0d5c7a217f
stabilize task::yield_now
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-12 02:10:55 +01:00
Stjepan Glavina
1a50ffd144 Delete unused import 2019-11-12 00:38:22 +01:00
Stjepan Glavina
21c5c48cb6 Lower the timeout to 1 second 2019-11-12 00:37:54 +01:00
Stjepan Glavina
6677d52c2d Improve thread creating algorithm in spawn_blocking 2019-11-12 00:35:29 +01:00
Johannes Weissmann
37922408e5 use pin_project 2019-11-11 22:17:29 +01:00
Johannes Weissmann
7d2282dbd2 fix merge conflict 2019-11-11 22:11:06 +01:00
Johannes Weissmann
60f822bee5 Merge branch 'master' into stream_count 2019-11-11 22:06:09 +01:00
Yoshua Wuyts
4aa9928ece
v1.0.0
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-11 16:13:22 +01:00
Stjepan Glavina
5438258cee Remove unused import 2019-11-11 13:19:59 +01:00
Wouter Geraedts
ef958f0408 Use pin_project_lite instead for throttle 2019-11-11 13:09:41 +01:00
Stjepan Glavina
dc5d143c16 Merge branch 'master' into cleanup-stream 2019-11-11 13:08:38 +01:00
Stjepan Glavina
c2f750d288 Cleanup stream module 2019-11-11 13:07:29 +01:00
Wouter Geraedts
139a34b685 Make throttle an unstable feature 2019-11-11 12:26:32 +01:00
Wouter Geraedts
b591fc68bd Changed semantics of throttle to non-dropping variant with backpressure 2019-11-11 12:17:00 +01:00
razican
5d558ca213
Fixed test, order is no longer guaranteed 2019-11-11 11:39:30 +01:00
razican
e48e463736
Duplicating code due to strange Rust error. 2019-11-11 11:26:40 +01:00
razican
0c37d4af10
Anonymous function to avoid type issues 2019-11-11 11:25:50 +01:00
Stjepan Glavina
352f18bc2a
Use async_std::sync::Arc in examples (#501) 2019-11-11 11:10:36 +01:00
razican
79bbf4938d
Randomize Stream::merge to improve the throughput. Implements #490. 2019-11-11 10:44:12 +01:00
Wouter Geraedts
14d7d3bf9c Merge remote-tracking branch 'upstream/master' into 342-stream-throttle 2019-11-11 10:15:27 +01:00
Stjepan Glavina
417b548692
Cleanup path module (#497)
* Cleanup path module

* Derive clone for PathBuf and remove unused import

* impl AsRef<Path> for std::path::PathBuf

* Fix a doc comment
2019-11-11 00:31:33 +01:00
Stjepan Glavina
122e87364b Remove cache padding in channels 2019-11-09 23:08:31 +01:00
Stjepan Glavina
d4f38e783f Cleanup future module 2019-11-09 17:26:19 +01:00
Yoshua Wuyts
96d3560742 remove future::*join macros (#492)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-09 17:02:48 +01:00
Yoshua Wuyts
ac1042a9ca note on Stream::merge ordering (#491)
* note on Stream::merge ordering

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

* Update src/stream/stream/mod.rs
2019-11-09 17:02:17 +01:00
Stjepan Glavina
9e185f1c3e
Unstable feature: copy takes arguments by value (#471)
* Unstable feature: copy takes arguments by value

* Fix feature flags
2019-11-09 16:59:35 +01:00
Yoshua Wuyts
89d611628a
Merge pull request #483 from ryan-scott-dev/rscott/pathbuf_fromiter
Add FromIterator and Extend trait implementations for PathBuf
2019-11-09 13:03:28 +01:00
Jayson Reis
d8e52c1002
Implement FromStr for PathBuf
This makes PathBuf compatible with std version as you can simply call
let path: PathBuf = FromStr::from_str(s).unwrap()
2019-11-09 12:14:56 +01:00
Yoshua Wuyts
037119c0c0
Merge pull request #478 from portgasd666/master
Add Future::join and Future::try_join
2019-11-09 11:31:47 +01:00
Stjepan Glavina
548733e5d5
Cleanup stream traits (#487)
* Cleanup stream traits

* Fix docs
2019-11-09 11:22:09 +01:00
Abhishek C. Sharma
f04b6f6fe9 Change module level docs for future to refer to join and try_join functions instead of macros 2019-11-09 13:09:47 +05:30
Friedel Ziegelmayer
4a78f731b7 fix: stream::take_while (#485)
When the predicate is false, the stream should be ended.
2019-11-09 00:00:03 +01:00
Ryan Scott
8f3366072f Add FromIterator and Extend trait implementations for PathBuf 2019-11-08 22:10:56 +11:00
laizy
fb19ebde17 add Sync constraint for RwLock to prevent memory unsafety (#479) 2019-11-08 08:56:55 +00:00
Abhishek C. Sharma
b14282457c Add Future::join and Future::try_join 2019-11-08 11:29:39 +05:30
Stjepan Glavina
ab2f64cd84 Mark extend() as unstable 2019-11-08 02:38:49 +01:00
Yoshua Wuyts
335bd34470 Add "std" feature flag (#476)
* core feature

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

* introduce std + default features

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

* test std features on ci

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

* finish up all features

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

* Fix task_local macro

* Remove crossbeam-channel and futures-timer from std

* Move future::timeout() behind cfg_default
2019-11-07 23:56:58 +00:00
Stjepan Glavina
f588ba6bdd
Spawn more than one blocking thread (#475)
* Spawn more than 1 blocking thread

* Fix a bug

* Fix check when the thread is last sleeping
2019-11-07 23:39:54 +00:00
Yoshua Wuyts
84880c4d8b re-export async-attributes (#238)
* re-export async-attributes

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

* doc order

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

* rebase + rename feature to "attributes"

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

* only expose test and main

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

* async-attributes 1.1.0

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-07 22:10:55 +00:00
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
2019-11-07 22:01:36 +00:00
Yoshua Wuyts
266e6326eb document path submodule (#467)
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-07 21:48:23 +00:00
Stjepan Glavina
f8e82564d9
Rename stream_extend to extend (#464)
* Rename stream_extend to extend

* Remove Extend from prelude

* Add stream::extend()
2019-11-07 21:46:58 +00:00
Abhishek C Sharma
eb1ef3f4e4 Minor documentation fix for race and try_race (#473) 2019-11-07 19:19:05 +00:00
Yoshua Wuyts
d0f1996759
Merge pull request #388 from felipesere/cycle
Implement stream::cycle(..)
2019-11-07 13:14:43 +01:00
Yoshua Wuyts
8a0e29473a
Merge pull request #446 from yjhmelody/stream-cloned
Add Stream cloned
2019-11-07 13:13:20 +01:00
Yoshua Wuyts
929027796e
hide future::Flatten
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-07 03:06:38 +01:00
Yoshua Wuyts
9a8805678e
Merge pull request #443 from portgasd666/master
Added Future::flatten
2019-11-07 03:04:23 +01:00
Yoshua Wuyts
a064a5b13e
Merge pull request #459 from stjepang/expose-ext-traits
Expose extension traits in preludes
2019-11-07 02:48:50 +01:00
Stjepan Glavina
c34e0f8a35
Update futures to 0.3 (#463)
* Update futures to 0.3

* Fix a search-and-replace error

* Fix imports in tests

* Fix an import
2019-11-06 20:20:27 +00:00
Stjepan Glavina
93b01e36ed
Clippy fixes (#462) 2019-11-06 19:29:17 +00:00
Gabriel Majeri
d502453057 Remove doc Stream impl for VecDeque (#461) 2019-11-06 08:35:31 +00:00
Yoshua Wuyts
3144e217ae
Merge pull request #458 from async-rs/rework-intro
rework lib.rs docs
2019-11-06 01:19:16 +01:00
Stjepan Glavina
c3254d78d9 Fix a re-rexport 2019-11-06 01:17:35 +01:00
Yoshua Wuyts
f4fb8a3534
change one line
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-06 01:04:46 +01:00
Yoshua Wuyts
1c87e97e9c
Apply suggestions from code review
Co-Authored-By: Stjepan Glavina <stjepang@gmail.com>
2019-11-06 01:02:39 +01:00
Stjepan Glavina
a757cc02dc Expose extension traits in preludes 2019-11-06 00:21:32 +01:00
Yoshua Wuyts
ae8b051892
rework lib.rs docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-05 21:00:12 +01:00
Stjepan Glavina
1707638ebb
Update mod.rs 2019-11-05 17:09:32 +00:00
Yoshua Wuyts
84fa4ca068
Merge pull request #456 from stjepang/doc-fixes-links
Fix some links in docs
2019-11-05 18:06:03 +01:00
Stjepan Glavina
43bb59cd02 Fix some links in docs 2019-11-05 17:49:05 +01:00
yjh
5179f30d2d
use async_std::stream 2019-11-05 21:15:33 +08:00
yjh
a35602f375
Update mod.rs 2019-11-05 21:08:56 +08:00
Yoshua Wuyts
e14cc2a30d
Merge pull request #452 from stjepang/fix-deadlocks
Fix a deadlock in channel
2019-11-05 11:27:00 +01:00
Stjepan Glavina
6d421de992 Fix another clippy warning 2019-11-05 10:16:00 +00:00
Stjepan Glavina
5874392397 Fix a clippy warning 2019-11-04 18:48:49 +01:00
Stjepan Glavina
e9edadffc7 Fix a deadlock in channel 2019-11-04 18:15:12 +01:00
Yoshua Wuyts
282ae064fe
Merge pull request #449 from async-rs/strip-vecdeque
remove remaining instances of VecDeque stream
2019-11-04 17:46:19 +01:00
yjh
e85bbe68e6
Merge branch 'master' into stream-cloned 2019-11-04 22:30:46 +08:00
Abhishek C. Sharma
d7afcada76 Fixed ambiguous associated types 2019-11-04 15:19:47 +05:30
Abhishek C. Sharma
e36172e808 Merge remote-tracking branch 'upstream/master' 2019-11-04 14:03:29 +05:30
Abhishek C. Sharma
a3e68704bc Wrap state enum in public struct 2019-11-04 13:58:14 +05:30
yjh
8bef812e78
Update src/stream/stream/cloned.rs
Co-Authored-By: nasa <htilcs1115@gmail.com>
2019-11-04 11:49:50 +08:00
yjh
bf0cd5987a
Update src/stream/stream/cloned.rs
Co-Authored-By: nasa <htilcs1115@gmail.com>
2019-11-04 11:49:43 +08:00
Stjepan Glavina
20cdf73bb0
Simplify RwLock using WakerSet (#440) 2019-11-04 02:40:55 +01:00
Yoshua Wuyts
ed1cb49807
remove remaining instances of VecDeque stream
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-04 01:57:53 +01:00
Stjepan Glavina
78614c6c1d
Clarify blocking in channel docs (#448) 2019-11-03 22:19:04 +01:00
nasa
ddbbbfc32a Replace VecDeque with stream::from_iter in examples (#447) 2019-11-03 13:40:51 +01:00
yjhmelody
4942dc7f9f Add Stream cloned 2019-11-03 19:19:52 +08:00
Abhishek C. Sharma
e0910be8fb Added Future::flatten 2019-11-03 11:34:49 +05:30
Felipe Sere
57a6516e63 Make bounds on Stream impl simpler 2019-11-02 22:24:12 -05:00
Felipe Sere
fbd5bd867d Revert "Only one generic type needed"
This reverts commit e9b9284863a614b852c22d58205cb983fc26682a.
2019-11-02 22:24:12 -05:00
Felipe Sere
9ee804f9ed Only one generic type needed 2019-11-02 22:24:12 -05:00
Felipe Seré
eaa56580e3 Update src/stream/stream/mod.rs
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
2019-11-02 22:24:12 -05:00
Felipe Sere
0186124aef Simpler impl 2019-11-02 22:24:12 -05:00
Felipe Sere
197253aa73 Run fmt 2019-11-02 22:24:12 -05:00
Felipe Sere
19381fa590 One clippy warning 2019-11-02 22:23:46 -05:00
Felipe Sere
ed5b095c73 Run fmt 2019-11-02 22:23:46 -05:00
Felipe Sere
5aadc5e4e9 Make cycle a function on the stream type 2019-11-02 22:23:46 -05:00
Felipe Sere
b979773505 Follow clippys advice 2019-11-02 22:23:46 -05:00
Felipe Sere
fd09e2f248 Run fmt 2019-11-02 22:23:46 -05:00
Felipe Sere
171cc82aed Replace copy with clone bound 2019-11-02 22:23:46 -05:00
Felipe Sere
83ff11ff4c Switch cycle to stream 2019-11-02 22:23:46 -05:00
Felipe Sere
e1ba87e7c1 Add slightly better docs 2019-11-02 22:23:46 -05:00
Felipe Sere
8126bb1882 use the module operator to calculate next index 2019-11-02 22:23:46 -05:00
Felipe Sere
486f9a964c Cycle over a known set of values. 2019-11-02 22:23:46 -05:00
Felipe Sere
a096d5ec2d stub out an example 2019-11-02 22:23:00 -05:00
Felipe Sere
dea1b67670 Skeleton cycle 2019-11-02 22:23:00 -05:00
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
2019-11-03 00:11:59 +01:00
Yoshua Wuyts
9a4f4c591c
Merge pull request #441 from async-rs/stdio-lock-unstable
mark stdio-lock structs as unstable
2019-11-03 00:05:11 +01:00
Yoshua Wuyts
6f9436e575
mark stdio-lock structs as unstable
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-02 23:54:27 +01:00
Yoshua Wuyts
735fa6954e Replace select!/try_select! with Future::{race,try_race} (#405)
* init Future::select

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

* implement Future::select

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

* try_select

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

* fixes

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

* works

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

* pass clippy

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

* please clippy

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

* implement feedback from stjepan

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

* rename select to race

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

* fmt

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-02 23:00:03 +01:00
yjh
3a2e6d5b92 add max_by_key (#408)
* add max_by_key

* fix conflict

* fmt code
2019-11-02 15:59:15 +01:00
Zhang Guyu
5fb9d3e980 add Stream::copied (#442) 2019-11-02 15:58:30 +01:00
Yoshua Wuyts
4c63392a85
Merge pull request #334 from k-nasa/add_stdin_lock
Locking for stdin
2019-11-02 14:18:36 +01:00
k-nasa
3dcad984b4 fix: To unstable feature 2019-11-02 12:34:53 +09:00
Yoshua Wuyts
911ebada0b
Merge pull request #434 from paulocsanz/master
Put everything behind a 'stable' feature to avoid future breaking changes
2019-11-02 01:33:52 +01:00
Aleksey Kladov
ec1a6ea3e8 Fix typo (#439) 2019-11-01 22:08:19 +01:00
Tyler Neely
5adc608791 Spawn several threads when we fail to enqueue work in the blocki… (#181)
* Rebase onto master

* Switch to unbounded channels
2019-11-01 21:53:13 +01:00
k-nasa
81873ae5f3 fix 2019-11-02 01:27:27 +09:00
Paulo
8e991bcd3a Fix typo 2019-11-01 10:59:38 -03:00
Paulo
2e66c38453 Simplify default feature 2019-11-01 10:58:51 -03:00
k-nasa
0661f774c2 Merge branch 'master' into add_stdin_lock 2019-11-01 21:20:38 +09:00
k-nasa
2f3c867d44 Merge branch 'master' into stream_from_iter 2019-11-01 21:19:53 +09:00
k-nasa
063798ce49 Add doc 2019-11-01 21:18:43 +09:00
Yoshua Wuyts
a3b742188d fix doc tests (#431)
* fix doc tests

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

* cargo fmt

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-01 12:54:43 +01:00
Paulo
dcd7c55cef Put everything behind a 'stable' feature 2019-11-01 00:41:38 -03:00
Stjepan Glavina
87de4e1598
Add utility type WakerSet to the sync module (#390)
* Add utility type Registry to the sync module

* Remove unused import

* Split unregister into complete and cancel

* Refactoring and renaming

* Split remove() into complete() and cancel()

* Rename to WakerSet

* Ignore clippy warning

* Ignore another clippy warning

* Use stronger SeqCst ordering
2019-11-01 02:45:50 +01:00
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
2019-11-01 02:45:33 +01:00
k-nasa
caa23381f0 fix clippy warning 2019-11-01 10:41:21 +09:00
k-nasa
eeb44c86e9 fix 2019-11-01 10:34:28 +09:00
k-nasa
f8b8c9debe Merge branch 'master' into add_stdin_lock 2019-11-01 10:10:49 +09:00
Yoshua Wuyts
cc75b65b8c
Merge pull request #409 from yjhmelody/stream-min
Add Stream min
2019-11-01 00:41:54 +01:00
Yoshua Wuyts
f102588df5
Merge pull request #428 from zhangguyu6/stream-position
Add stream position
2019-11-01 00:33:39 +01:00
Yoshua Wuyts
3e0fe742f6
Merge pull request #427 from yjhmelody/stream-ne
Add stream ne
2019-11-01 00:29:21 +01:00
zhangguyu
07d21e5eb3 change trait bounds 2019-10-31 23:30:11 +08:00
zhangguyu
48c82a9668 Add stream position 2019-10-31 22:33:17 +08:00
yjhmelody
1ab3d901e4 fmt code 2019-10-31 21:17:07 +08:00
yjhmelody
204da33391 fmt code 2019-10-31 21:16:13 +08:00
yjhmelody
17db7ffcd3 Add stream ne 2019-10-31 20:18:53 +08:00
yjhmelody
f5efaaa7ba Add stream eq 2019-10-31 14:44:19 +08:00
Wu Yu Wei
ff6a44fcd5 Use once_cell instead of lazy_static (#416)
`once_cell` provides a neat way of initializing lazy singletons without
macro. This PR use `sync::Lazy` to streamline same pattern proposed in
related rust RFC.

Resolve #406
2019-10-30 11:23:08 +00:00
k-nasa
40c4e1a29d feat: Add stream::from_iter 2019-10-30 10:39:05 +09:00
k-nasa
2c91b30ee8 feat: Add Read and Write trait to Lock struct 2019-10-29 23:12:32 +09:00
yjhmelody
021862dcc8 fix min 2019-10-29 21:49:30 +08:00
yjhmelody
b942d0a405 add stream-min 2019-10-29 21:44:56 +08:00
Yoshua Wuyts
2b1c6f04ea
Merge pull request #384 from yjhmelody/stream-max_by
add stream::max_by method
2019-10-29 11:19:50 +01:00
Yoshua Wuyts
5ff4ef8dd4
Merge pull request #385 from yjhmelody/stream-min_by_key
add stream::min_by_key method
2019-10-29 11:18:34 +01:00
Yoshua Wuyts
f311e3de9f
Merge pull request #397 from async-rs/sync-docs
add mod level docs for sync
2019-10-29 11:07:56 +01:00
Yoshua Wuyts
3a06a1211b
Add feedback from review
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-29 10:56:33 +01:00
Yoshua Wuyts
526c4da21a
Merge pull request #395 from async-rs/stream-docs
add stream mod docs
2019-10-29 10:50:26 +01:00
Yoshua Wuyts
997e811c58
Merge pull request #402 from async-rs/fuse-docs
update Stream::fuse docs
2019-10-29 10:49:43 +01:00
Yoshua Wuyts
11d0577407
Merge pull request #396 from async-rs/net-docs
standardize net docs
2019-10-29 10:30:45 +01:00
Yoshua Wuyts
eb081b1948
Apply suggestions from code review
Co-Authored-By: Florian Gilcher <florian.gilcher@ferrous-systems.com>
2019-10-29 10:23:54 +01:00
k-nasa
35cb11e398 Merge branch 'master' into add_stdin_lock 2019-10-29 16:01:58 +09:00
Yoshua Wuyts
1175a37c47
Merge pull request #367 from k-nasa/add_stream_flatten
Add Stream::flatten and Stream::flat_map
2019-10-29 02:22:04 +01:00
k-nasa
1554b04407 $cargo fmt 2019-10-29 10:12:22 +09:00
k-nasa
1545d24e50 Merge branch 'master' into add_future_delay 2019-10-29 10:09:09 +09:00
k-nasa
ae7adf2c36 fix: Remove unused import 2019-10-29 10:01:41 +09:00
k-nasa
040227f38a Merge branch 'master' into add_stream_flatten 2019-10-29 09:58:10 +09:00
k-nasa
688976203e fix: Split FlattenCompat logic to Flatten and FlatMap 2019-10-29 09:52:50 +09:00
k-nasa
c7dc147f73 fix indent 2019-10-29 09:27:35 +09:00
Yoshua Wuyts
b3ae6f2b03
update Stream::fuse docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 13:02:13 +01:00
Yoshua Wuyts
4346386610
fix doc recursion limit
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 12:42:23 +01:00
Yoshua Wuyts
ca4856a0e8
Merge pull request #377 from ktomsic/sum-and-product-impls
Add `Stream::sum()` and `Stream::product()` implementations
2019-10-28 12:34:30 +01:00
Yoshua Wuyts
e5675151b9
Merge pull request #364 from stjepang/optimize-flushing
Don't flush files if they weren't written to
2019-10-28 12:19:15 +01:00
Yoshua Wuyts
fd940b8c6a
Merge pull request #348 from k-nasa/add_stream_timeout
Add stream timeout
2019-10-28 12:12:02 +01:00
Yoshua Wuyts
1baee98ead
Merge pull request #375 from sunjay/fromstream-pathbuf
Added Extend + FromStream for PathBuf
2019-10-28 10:34:48 +01:00
k-nasa
613895d6be doc: fix documantation text 2019-10-28 13:58:54 +09:00
Florian Gilcher
f262fd8a40
Merge pull request #392 from taiki-e/clippy
Remove usage of actions-rs/clippy-check
2019-10-27 20:26:43 -07:00
Florian Gilcher
c2a084ed4a
Merge pull request #393 from k-nasa/fix_clippy
Fix clippy warnings
2019-10-27 20:22:35 -07:00
Yoshua Wuyts
5f8e2cbd4a
add mod level docs for sync
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 00:34:27 +01:00
Yoshua Wuyts
20abd5cebf
standardize net docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 00:15:13 +01:00
Yoshua Wuyts
4c4604d63e
add stream mod docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 00:08:32 +01:00
Yoshua Wuyts
4475a229d6
backlink io docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-27 22:46:18 +01:00
Yoshua Wuyts
a3a740c14a
backlink all docs
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-27 22:29:20 +01:00
k-nasa
59615a655b feat: Add StderrLock and StdoutLock struct 2019-10-27 22:04:43 +09:00
k-nasa
fe49f2618f fix clippy::redundant_clone 2019-10-27 20:34:44 +09:00
k-nasa
7c293d37f7 fix clippy::comparison_chain 2019-10-27 20:32:22 +09:00
nasa
a42ae2f3d9
Narrow the disclosure range of FlattenCompat::new
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 12:35:51 +09:00
nasa
37f14b0195
Narrow the disclosure range of Flatten::new
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 12:35:32 +09:00
nasa
13a08b0d54
Narrow the disclosure range of FlatMap::new
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 12:35:14 +09:00
Johannes Weissmann
75546ef831 Merge branch 'master' into stream_count 2019-10-26 23:18:04 +02:00
Johannes Weissmann
6608d39c59 remove Stream trait bound 2019-10-26 21:58:34 +02:00
Taiki Endo
6549b66ad2 run clippy check on beta & address clippy warnings 2019-10-27 03:28:20 +09:00
yjhmelody
7cfec4e8ce use take and remove Copy 2019-10-27 00:26:19 +08:00
yjh
fb78ed1812
Update src/stream/stream/min_by_key.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 00:19:49 +08:00
yjh
5a4fdeb1cd
Update src/stream/stream/min_by_key.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 00:18:18 +08:00
yjh
b57849e1cb
Update src/stream/stream/max_by.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 00:18:01 +08:00
yjh
a8d3d1483f
Update src/stream/stream/max_by.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 00:17:50 +08:00
yjh
006fc7e9de
Update src/stream/stream/max_by.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-27 00:17:42 +08:00
yjhmelody
c9e6d3a84c use pin_project_lite 2019-10-26 12:59:43 +08:00
yjhmelody
37a7eadf17 use pin_project_lite 2019-10-26 11:52:41 +08:00
yjhmelody
d0c3c9172b Merge branch 'master' of git://github.com/async-std/async-std into stream-max_by 2019-10-26 11:34:59 +08:00
k-nasa
61b7a09c70 Fix type declaration 2019-10-26 01:45:12 +09:00
nasa
8932cecec7
Update src/stream/stream/flatten.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-26 01:43:14 +09:00
nasa
bf3508ffb2
Update src/stream/stream/flatten.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-26 01:43:07 +09:00
nasa
6168952d6f
Update src/stream/stream/flatten.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-26 01:42:57 +09:00
nasa
b7b5df13aa
Update src/stream/stream/flatten.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-26 01:42:39 +09:00
nasa
7ce721f562
Update src/lib.rs
Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2019-10-26 01:42:19 +09:00
k-nasa
b66ffa670e update recursion_limit 2019-10-26 00:42:27 +09:00
k-nasa
0c5abee284 to unstable stream::flat_map, stream::flatten 2019-10-26 00:36:04 +09:00
k-nasa
001368d3df $cargo fmt 2019-10-26 00:29:10 +09:00
k-nasa
00e7e58bf3 fix type def 2019-10-26 00:26:53 +09:00
k-nasa
271b6f4a1c fix: Using pin_project! 2019-10-25 23:58:08 +09:00
k-nasa
3297a0f327 Merge branch 'master' into add_stream_flatten 2019-10-25 23:34:44 +09:00
k-nasa
48b255897e Merge branch 'master' into add_stdin_lock 2019-10-24 18:34:42 +09:00
k-nasa
feeb3c10df fix: Remove Pin API related unsafe code 2019-10-24 08:41:01 +09:00
k-nasa
b17af61367 Merge branch 'master' into add_stream_timeout 2019-10-24 08:40:43 +09:00
k-nasa
d97b3dfdf3 fix: Remove Pin API related unsafe code 2019-10-24 08:29:05 +09:00
k-nasa
5c9cfb4fe8 Merge branch 'master' into add_future_delay 2019-10-24 08:23:01 +09:00
Wouter Geraedts
1fd05a157f Reset delay to prevent poll after ready 2019-10-23 22:34:39 +02:00
Wouter Geraedts
1c843a8124 Re-implemented Throttle to keep last value in memory 2019-10-23 22:27:51 +02:00
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
2019-10-23 17:02:03 +01:00
Taiki Endo
2abf5ca891
Deny warnings on CI (#378)
* Deny warnings on CI

* Fix some clippy warnings
2019-10-23 20:20:59 +09:00
yjhmelody
f5a0a0ba86 fmt 2019-10-23 19:17:24 +08:00
yjhmelody
d6f940110b update doc 2019-10-23 19:04:04 +08:00
yjhmelody
020eb85093 add stream::min_by_key method 2019-10-23 18:59:06 +08:00
Taiki Endo
944e43d4bf Remove Pin API related unsafe code by using pin-project-lite cra… (#381) 2019-10-23 10:35:02 +01:00
yjhmelody
4e5828e646 add stream::max_by method 2019-10-23 16:46:11 +08:00
Kyle Tomsic
e26eb7a719 Add Stream::sum() and Stream::product() implementations
These are the stream equivalents to `std::iter::Iterator::sum()` and
`std::iter::Iterator::product()`.

Note that this changeset tweaks the `Stream::Sum` and `Stream::Product`
traits a little: rather than returning a generic future `F`, they return
a pinned, boxed, `Future` trait object now. This is in line with other
traits that return a future, e.g. `FromStream`.
2019-10-22 20:30:27 -04:00
Sunjay Varma
0d4a907335 Added Extend + FromStream for PathBuf 2019-10-20 19:18:37 -04:00
Johannes Weissmann
97094b2a1c remove Sized constraint 2019-10-20 22:03:51 +02:00
Wouter Geraedts
ced5281b73 Merge remote-tracking branch 'upstream/master' into 342-stream-throttle 2019-10-20 16:50:31 +02:00
Johannes Weissmann
a9a7bdc290 add stream::count 2019-10-18 07:23:52 +02:00
k-nasa
410d16eaf6 Add docs + To unstable feature 2019-10-18 13:20:44 +09:00
k-nasa
1c1e2230f3 Merge branch 'master' into add_stream_flatten 2019-10-18 12:47:48 +09:00
k-nasa
176359afae Add Stream::flatten 2019-10-18 12:20:28 +09:00
k-nasa
8138afbfad feat: Add Stream trait for Flatten 2019-10-18 12:20:02 +09:00
k-nasa
cd862083a5 Add Flatten struct 2019-10-18 12:19:38 +09:00
k-nasa
2187a2a31d feat: Add Stream::flat_map 2019-10-18 10:43:36 +09:00
k-nasa
2dee289750 Add FlatMap struct 2019-10-18 10:43:21 +09:00
k-nasa
bb1416420d feat: Add Stream trait for FlattenCompat 2019-10-18 10:34:53 +09:00
Stjepan Glavina
8bef2e9e95 Don't flush files if they weren't written to 2019-10-17 21:28:38 +02:00
Stjepan Glavina
ec23632f3e
Cleanup: replace cfg-if with our macros (#361)
* Cleanup: replace cfg-if with our macros

* Prefix macros with cfg_

* Remove #[macro_export] from internal macros
2019-10-17 19:17:49 +02:00
k-nasa
ec98b41c85 feat: Add FlattenCompat struct 2019-10-17 23:56:01 +09:00
Stjepan Glavina
46f0fb1c64
Make sure each invocation of block_on uses its own Parker (#358) 2019-10-17 11:52:42 +02:00
k-nasa
f2bf01223c $cargo fmt 2019-10-17 16:34:39 +09:00
k-nasa
70e8476264 fix StdinLock doc test 2019-10-17 16:32:14 +09:00
k-nasa
a5a00d7b14 feat: Add StdinLock struct 2019-10-17 16:29:23 +09:00
Wouter Geraedts
a2393501c5 Implemented StreamExt::throttle 2019-10-16 18:43:34 +02:00
k-nasa
b58bd8d725 Merge branch 'add_stream_timeout' of https://github.com/k-nasa/async-std into add_stream_timeout 2019-10-16 23:08:23 +09:00
k-nasa
0a4073449b doc: Add Stream::Timeout doc 2019-10-16 22:56:48 +09:00
k-nasa
c3f6f969c5 fix: Rename TimeoutStream to Timeout 2019-10-16 22:56:17 +09:00
k-nasa
53fa132d13 fix type Declaration 2019-10-16 22:45:18 +09:00