|
1 |
| -# async-task |
| 1 | +<h1 align="center">async-task</h1> |
| 2 | +<div align="center"> |
| 3 | + <strong> |
| 4 | + A task abstraction for building executors. |
| 5 | + </strong> |
| 6 | +</div> |
2 | 7 |
|
3 |
| -[](https://travis-ci.com/async-rs/async-task) |
4 |
| -[]( |
5 |
| -https://github.com/async-rs/async-task) |
6 |
| -[](https://crates.io/crates/async-task) |
7 |
| -[](https://docs.rs/async-task) |
8 |
| -[](https://discord.gg/JvZeVNe) |
| 8 | +<br /> |
9 | 9 |
|
10 |
| -Task abstraction for building executors. |
| 10 | +<div align="center"> |
| 11 | + <!-- Crates version --> |
| 12 | + <a href="https://crates.io/crates/async-task"> |
| 13 | + <img src="https://img.shields.io/crates/v/async-task.svg?style=flat-square" |
| 14 | + alt="Crates.io version" /> |
| 15 | + </a> |
| 16 | + <!-- Downloads --> |
| 17 | + <a href="https://crates.io/crates/async-task"> |
| 18 | + <img src="https://img.shields.io/crates/d/async-task.svg?style=flat-square" |
| 19 | + alt="Download" /> |
| 20 | + </a> |
| 21 | + <!-- docs.rs docs --> |
| 22 | + <a href="https://docs.rs/async-task"> |
| 23 | + <img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" |
| 24 | + alt="docs.rs docs" /> |
| 25 | + </a> |
| 26 | + <a href="https://discord.gg/JvZeVNe"> |
| 27 | + <img src="https://img.shields.io/discord/598880689856970762.svg?logo=discord&style=flat-square" |
| 28 | + alt="chat" /> |
| 29 | + </a> |
| 30 | +</div> |
11 | 31 |
|
12 |
| -To spawn a future onto an executor, we first need to allocate it on the heap and keep some |
13 |
| -state alongside it. The state indicates whether the future is ready for polling, waiting to be |
14 |
| -woken up, or completed. Such a future is called a *task*. |
| 32 | +<div align="center"> |
| 33 | + <h3> |
| 34 | + <a href="https://docs.rs/async-task"> |
| 35 | + API Docs |
| 36 | + </a> |
| 37 | + <span> | </span> |
| 38 | + <a href="https://github.com/async-rs/async-task/releases"> |
| 39 | + Releases |
| 40 | + </a> |
| 41 | + <span> | </span> |
| 42 | + <a href="https://async.rs/contribute"> |
| 43 | + Contributing |
| 44 | + </a> |
| 45 | + </h3> |
| 46 | +</div> |
15 | 47 |
|
16 |
| -This crate helps with task allocation and polling its future to completion. |
| 48 | +## Installation |
17 | 49 |
|
18 |
| -## License |
| 50 | +With [cargo add][cargo-add] installed run: |
| 51 | + |
| 52 | +```sh |
| 53 | +$ cargo add async-task |
| 54 | +``` |
| 55 | + |
| 56 | +[cargo-add]: https://github.com/killercup/cargo-edit |
| 57 | + |
| 58 | +## Safety |
| 59 | +This crate makes use of carefully checked `unsafe` blocks to construct an |
| 60 | +efficient timer implementation. |
19 | 61 |
|
20 |
| -Licensed under either of |
| 62 | +## Contributing |
| 63 | +Want to join us? Check out our ["Contributing" guide][contributing] and take a |
| 64 | +look at some of these issues: |
21 | 65 |
|
22 |
| - * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) |
23 |
| - * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) |
| 66 | +- [Issues labeled "good first issue"][good-first-issue] |
| 67 | +- [Issues labeled "help wanted"][help-wanted] |
| 68 | + |
| 69 | +[contributing]: https://github.com/async-rs/async-task/blob/master.github/CONTRIBUTING.md |
| 70 | +[good-first-issue]: https://github.com/async-rs/async-task/labels/good%20first%20issue |
| 71 | +[help-wanted]: https://github.com/async-rs/async-task/labels/help%20wanted |
| 72 | + |
| 73 | +## License |
24 | 74 |
|
25 |
| -at your option. |
| 75 | +<sup> |
| 76 | +Licensed under either of <a href="LICENSE-APACHE">Apache License, Version |
| 77 | +2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option. |
| 78 | +</sup> |
26 | 79 |
|
27 |
| -#### Contribution |
| 80 | +<br/> |
28 | 81 |
|
| 82 | +<sub> |
29 | 83 | Unless you explicitly state otherwise, any contribution intentionally submitted
|
30 |
| -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be |
31 |
| -dual licensed as above, without any additional terms or conditions. |
| 84 | +for inclusion in this crate by you, as defined in the Apache-2.0 license, shall |
| 85 | +be dual licensed as above, without any additional terms or conditions. |
| 86 | +</sub> |
0 commit comments