-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] async
and .await
chapter with all changes
#3908
base: main
Are you sure you want to change the base?
Commits on Apr 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0ec7296 - Browse repository at this point
Copy the full SHA 0ec7296View commit details -
We will primarily just be re-exporting this, though we may also have a couple cases where we choose to implement something small around it.
Configuration menu - View commit details
-
Copy full SHA for fcd470c - Browse repository at this point
Copy the full SHA fcd470cView commit details -
Re-export
tokio::main
astrpl::async_main
and test it.1. Introduce an integration tests crate. Structure it the way people *should* for large crates (although this is not that) and document why, including linking to a relevant post. 2. Add a basic integration test that verifies the re-export works as it should. (This is not exactly rocket science, but we want to make sure these things don’t just stop working on accident.) An open question that remains here: do we want some structure to the crate beyond the top level re-exports? My inclination at this moment is: no, because we don’t have any *motivation* for that, and naming things is difficult. (We cannot do `trpl::async`, for example, because `async` is a keyword!)
Configuration menu - View commit details
-
Copy full SHA for 3943e51 - Browse repository at this point
Copy the full SHA 3943e51View commit details -
Configuration menu - View commit details
-
Copy full SHA for e518289 - Browse repository at this point
Copy the full SHA e518289View commit details -
Configuration menu - View commit details
-
Copy full SHA for 608c35b - Browse repository at this point
Copy the full SHA 608c35bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 71ea12e - Browse repository at this point
Copy the full SHA 71ea12eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4255d87 - Browse repository at this point
Copy the full SHA 4255d87View commit details
Commits on Apr 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7c40849 - Browse repository at this point
Copy the full SHA 7c40849View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1a0d14 - Browse repository at this point
Copy the full SHA c1a0d14View commit details -
Configuration menu - View commit details
-
Copy full SHA for d17c712 - Browse repository at this point
Copy the full SHA d17c712View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ce722d - Browse repository at this point
Copy the full SHA 4ce722dView commit details -
Ch. 17: Add some introductory material about async/await
- 17.00: Introduction to the conceptual machinery. This is very nascent but has some decent bones. - 17.01: Trying to get at the foundations for tasks, laziness, etc.; this is *especially* incomplete. - 17.02: Just a paragraph I do not want to lose, which I think *will* be useful… eventually.
Configuration menu - View commit details
-
Copy full SHA for 71d92ec - Browse repository at this point
Copy the full SHA 71d92ecView commit details -
Ch. 17: Introduce runtimes and the
trpl
crateAdd a fair bit more material about the `futures` executor and why we might prefer to use something else. With that motivation in place, have the readers add our `trpl` crate. (We can of course rename that crate, but it does the job for now.) Use it to get the equivalent of `#[tokio::main]` equivalent and incorporate it into an example.
Configuration menu - View commit details
-
Copy full SHA for fdb3794 - Browse repository at this point
Copy the full SHA fdb3794View commit details
Commits on May 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for cf00f05 - Browse repository at this point
Copy the full SHA cf00f05View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02b0bd1 - Browse repository at this point
Copy the full SHA 02b0bd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94d95c6 - Browse repository at this point
Copy the full SHA 94d95c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4bcb2c - Browse repository at this point
Copy the full SHA b4bcb2cView commit details
Commits on May 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 63baf22 - Browse repository at this point
Copy the full SHA 63baf22View commit details -
Ch. 17: get to working async code sooner
Move up the installation of the futures crate: get the initial example compiling as soon as possible (even though it is just "Hello, world!") and *then* explain what was going on.
Configuration menu - View commit details
-
Copy full SHA for c31d308 - Browse repository at this point
Copy the full SHA c31d308View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0721b04 - Browse repository at this point
Copy the full SHA 0721b04View commit details -
Configuration menu - View commit details
-
Copy full SHA for dee7220 - Browse repository at this point
Copy the full SHA dee7220View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b3c27e - Browse repository at this point
Copy the full SHA 5b3c27eView commit details -
Ch. 17: use
trpl
, notfutures
, even for initial code samples- Update the instructions to install `trpl` instead of `futures`, and move the introductory text there. - Update the note about Tokio in 17.02 to describe both `futures` and `tokio`.
Configuration menu - View commit details
-
Copy full SHA for ebebf8c - Browse repository at this point
Copy the full SHA ebebf8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee0704d - Browse repository at this point
Copy the full SHA ee0704dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40df049 - Browse repository at this point
Copy the full SHA 40df049View commit details -
Configuration menu - View commit details
-
Copy full SHA for a150365 - Browse repository at this point
Copy the full SHA a150365View commit details
Commits on May 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 45bda34 - Browse repository at this point
Copy the full SHA 45bda34View commit details -
Ch. 17: expand, clarify, and restructure 17.01
- Explicitly section out the discussions of async functions and blocks and the associated `async` and `.await` syntax from defining `Future` and explaining how it works. - Also a bunch of small phrasing tweaks.
Configuration menu - View commit details
-
Copy full SHA for 8f6bcc7 - Browse repository at this point
Copy the full SHA 8f6bcc7View commit details
Commits on Jun 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0c00b17 - Browse repository at this point
Copy the full SHA 0c00b17View commit details -
Configuration menu - View commit details
-
Copy full SHA for 23027cb - Browse repository at this point
Copy the full SHA 23027cbView commit details -
Ch. 17: corrections/discussion on runtimes, mostly
- Tie off the discussion about needing a runtime so that it is clear what is needed in `main` and therefore why `main` cannot natively be `async` itself. - Correct the description of what `.await` compiles to. - Extend the note about the “under the hood” bits: mention generators so people know what to go looking for if they are curious. - Rewrite the existing introduction of the `#[async_main]` macro to lean on the material now covered in the previous chapter.
Configuration menu - View commit details
-
Copy full SHA for 3cf4fae - Browse repository at this point
Copy the full SHA 3cf4faeView commit details -
Configuration menu - View commit details
-
Copy full SHA for c3ebabe - Browse repository at this point
Copy the full SHA c3ebabeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5657a49 - Browse repository at this point
Copy the full SHA 5657a49View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbd5e14 - Browse repository at this point
Copy the full SHA dbd5e14View commit details -
Ch. 17: eliminate duplicate runtime description
Keep both references, but make the first one a simple definition, and the second one the “ah, now we can make sense of that definition”.
Configuration menu - View commit details
-
Copy full SHA for b4e3030 - Browse repository at this point
Copy the full SHA b4e3030View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96fd725 - Browse repository at this point
Copy the full SHA 96fd725View commit details -
Configuration menu - View commit details
-
Copy full SHA for 95105d2 - Browse repository at this point
Copy the full SHA 95105d2View commit details -
Ch. 17: abandon attempt to re-export
tokio::main
Re-exporting the macro does not work unless you have `tokio` as a direct dependency, because its expansion is in terms of Tokio doc-hidden items.
Configuration menu - View commit details
-
Copy full SHA for f418ceb - Browse repository at this point
Copy the full SHA f418cebView commit details -
Ch. 17: start in earnest on §2, showing relation to threads
Add some listings which I can actually run, with `TODO` paths in them since I do not know what the numbers will be, since I have not actually finished with §0 or §1 yet!
Configuration menu - View commit details
-
Copy full SHA for 8e7420e - Browse repository at this point
Copy the full SHA 8e7420eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ee7975 - Browse repository at this point
Copy the full SHA 1ee7975View commit details -
Ch. 17: Finish 'Counting', start on 'Async Move Blocks'
Also rename the files to match their actual titles now that I know them. Or at least: know a good first pass for them.
Configuration menu - View commit details
-
Copy full SHA for 9c1f4c8 - Browse repository at this point
Copy the full SHA 9c1f4c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for dacddb5 - Browse repository at this point
Copy the full SHA dacddb5View commit details -
Ch. 17: start on message-passing and
async move
in §2- Introduce the relevant supporting features in `trpl`. - Add a couple listings to show how things do or do not work.
Configuration menu - View commit details
-
Copy full SHA for c1c3c7f - Browse repository at this point
Copy the full SHA c1c3c7fView commit details -
Ch. 17: Finish a pass on Message Passing example
- Incorporate a good discusion of the need to make sure that the `tx` in this example gets dropped. - Add more listings which show borrowing vs. moving a `tx`, covering the full territory in that example. - Add and test more re-exports in `trpl`. I made a conscious choice here *not* to use `future::join_all()` because that ends up getting into a discussion of `Pin`. I left a TODO item here for now because I think it is probably worth getting into, and that could be a good thing to transition to *after* this section.
Configuration menu - View commit details
-
Copy full SHA for 4b7886e - Browse repository at this point
Copy the full SHA 4b7886eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b835c07 - Browse repository at this point
Copy the full SHA b835c07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e09f02 - Browse repository at this point
Copy the full SHA 5e09f02View commit details -
It should manage its own dependencies.
Configuration menu - View commit details
-
Copy full SHA for 5483299 - Browse repository at this point
Copy the full SHA 5483299View commit details -
Ch. 17: skip
main
andtrpl::block_on
in some listingsWherever it makes sense to elide these for the sake of clarity, do so!
Configuration menu - View commit details
-
Copy full SHA for acde825 - Browse repository at this point
Copy the full SHA acde825View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b14d7d - Browse repository at this point
Copy the full SHA 7b14d7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89b3b25 - Browse repository at this point
Copy the full SHA 89b3b25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d7c987 - Browse repository at this point
Copy the full SHA 1d7c987View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1db4ee2 - Browse repository at this point
Copy the full SHA 1db4ee2View commit details -
Configuration menu - View commit details
-
Copy full SHA for af18d2b - Browse repository at this point
Copy the full SHA af18d2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b3fe5b7 - Browse repository at this point
Copy the full SHA b3fe5b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1847bf - Browse repository at this point
Copy the full SHA c1847bfView commit details -
Ch. 17: further motivation for async w/examples
I am not 100% sure we will keep these, but right now they feel useful for helping see how `async` can help solve some of these problems.
Configuration menu - View commit details
-
Copy full SHA for 1010b1f - Browse repository at this point
Copy the full SHA 1010b1fView commit details -
Ch. 17: rework §00 to talk about reads instead of writes
This lets me combine the examples of trying to get data “out” with the existing network socket example, rather than introducing yet another imaginary API, and gives us a final API that looks much closer to what users will actually see with a real world socket.
Configuration menu - View commit details
-
Copy full SHA for 8ce6c8a - Browse repository at this point
Copy the full SHA 8ce6c8aView commit details -
Ch. 17: extract parallelism discussion from §00 to §03
§03 is the current place I expect to tackle the distinctions between threads, tasks, and futures, and is therefore a reasonable home for a brief discussion on these two big ideas, I think?
Configuration menu - View commit details
-
Copy full SHA for 52bf9e4 - Browse repository at this point
Copy the full SHA 52bf9e4View commit details -
Ch. 17: dedicate §03 to 'Futures, Tasks, and Threads'
- Move the heading out from §03. - Add this to the summary.
Configuration menu - View commit details
-
Copy full SHA for 3224ceb - Browse repository at this point
Copy the full SHA 3224cebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82f47c3 - Browse repository at this point
Copy the full SHA 82f47c3View commit details -
Ch. 17: Fill out message-passing example
- Gradually build up to the full thing, rather than dumping it all at once at the start. - Show several more “false starts” along the way, using them to teach a couple key ideas about async and control flow. - Update the listings to have their actual expected numbers.
Configuration menu - View commit details
-
Copy full SHA for 91ffec8 - Browse repository at this point
Copy the full SHA 91ffec8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3d7c64 - Browse repository at this point
Copy the full SHA d3d7c64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91348ca - Browse repository at this point
Copy the full SHA 91348caView commit details -
Ch 17.02: motivating
futures::join!
andBox::pin
Up to this point, the chapter has stuck to `join` and `join3`, as simple function-based APIs. The `join_all` API is obviously more convenient than those *if you can use it*, but being able to use it requires having something which `impl Iterator` of a given type, and therefore demands a homogeneous type, which motivates introducing `Box::pin`. That in turn is quite annoying to work with and requires `Output = <same>` for all the futures in the collection, because of how `join_all` is typed (Rust does not have the ability to do do variadic types, which is what would be necessary for `join_all` to work the way we might want). Thus, we get a motivation for `futures::join!`, which unlike `join_all` *can* work with heterogeneous types. This fills out a fair bit of the text here and adds a lot of the listing support, and outlines what remains to do text-wise.
Configuration menu - View commit details
-
Copy full SHA for 068f30b - Browse repository at this point
Copy the full SHA 068f30bView commit details -
Ch. 17: finish motivating
Pin
andpin!
This does not yet actually *explain* either of them, but it gets us to the point where an explanation is well-motivated and can make some sense, and it (more or less successfully) covers the set of errors that gets us to that point.
Configuration menu - View commit details
-
Copy full SHA for 7a5bdb2 - Browse repository at this point
Copy the full SHA 7a5bdb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 626aec8 - Browse repository at this point
Copy the full SHA 626aec8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40a3dc1 - Browse repository at this point
Copy the full SHA 40a3dc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for b382767 - Browse repository at this point
Copy the full SHA b382767View commit details -
Ch. 17: Iterate on explanation of
Pin
andUnpin
This is (a) far from perfect and (b) far from done, but it represents a useful increment of work and includes a bunch of notes for where to go next with this quite tricky section. listings/ch17-async-await/listing-17-13/src/main.rs JJ: M listings/ch17-async-await/listing-17-14/src/main.rs JJ: M src/ch17-02-concurrency-with-async.md
Configuration menu - View commit details
-
Copy full SHA for e000ea3 - Browse repository at this point
Copy the full SHA e000ea3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0032e07 - Browse repository at this point
Copy the full SHA 0032e07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4236371 - Browse repository at this point
Copy the full SHA 4236371View commit details -
Configuration menu - View commit details
-
Copy full SHA for 97f5bcc - Browse repository at this point
Copy the full SHA 97f5bccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 888a519 - Browse repository at this point
Copy the full SHA 888a519View commit details -
Ch. 17 §02: Start showing timeouts
This also has the setup for showing `select`, but currently jumps ahead to showing a `timeout` example.
Configuration menu - View commit details
-
Copy full SHA for c6965ca - Browse repository at this point
Copy the full SHA c6965caView commit details -
Configuration menu - View commit details
-
Copy full SHA for c58f943 - Browse repository at this point
Copy the full SHA c58f943View commit details -
Ch. 17 §02: Implement
timeout
example and building blocksCreate a `trpl::race` function which simplifies the `select` API by ignoring the future which resolves second. Use the `race` function to show how you can implement an even simpler `timeout` function on top of it, i.e. showing how futures can compose nicely. With that in place, there is enough to be able to “work up to it” in the body of the text.
Configuration menu - View commit details
-
Copy full SHA for 7da440a - Browse repository at this point
Copy the full SHA 7da440aView commit details -
Ch. 17: build a
retry
implementationThis is good to know about, but has significant problems, mostly down to the issues Niko covers in [this post][post] regarding the way ownership and closures interact. See [this Stack Overflow answer][so], which applies that dynamic specifically to a `retry` implementation which happens to be more or less identical to what I built here! [post]: https://smallcultfollowing.com/babysteps/blog/2023/05/09/giving-lending-and-async-closures/ [answer]: https://stackoverflow.com/questions/75533630/how-to-write-a-retry-function-in-rust-that-involves-async
Configuration menu - View commit details
-
Copy full SHA for 270780a - Browse repository at this point
Copy the full SHA 270780aView commit details -
Ch. 17: Drop material about
retry
, since it is a hazardAs described in the parent commit, what I have here technically works but is adjacent to an area of the language which does *not* yet work as well as we might hope: closures which involve async. Since even the smallest refactor here (extracting the future *or* the closure to a standalone binding) breaks the code, best to remove it entirely in favor of some other example of composing futures together. backout of commit d5ed8de
Configuration menu - View commit details
-
Copy full SHA for 1c27c97 - Browse repository at this point
Copy the full SHA 1c27c97View commit details -
Ch. 17 §02: Write about
race
andyield_now
- Update the implementation for `race` to use `futures::future::Either` instead of duplicating the type, and update the test not to try to use equality. - Add a `pub use` for `tokio::task::yield_now`.
Configuration menu - View commit details
-
Copy full SHA for 71acd6d - Browse repository at this point
Copy the full SHA 71acd6dView commit details -
Ch. 17: Split the over-long §02 into two parts
…and fix a bunch of the listing references and make some word choice and sentence structure improvements along the way to boot.
Configuration menu - View commit details
-
Copy full SHA for 5a0fb42 - Browse repository at this point
Copy the full SHA 5a0fb42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86835d6 - Browse repository at this point
Copy the full SHA 86835d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a364865 - Browse repository at this point
Copy the full SHA a364865View commit details -
Configuration menu - View commit details
-
Copy full SHA for f4cd9d2 - Browse repository at this point
Copy the full SHA f4cd9d2View commit details -
Ch. 17 §01: Add necessary background for §04 to make sense
Fix some infelicitous wording along the way, and leave a TODO item to come back to for making more sense out of the text as it stands at the conclusion of the chapter.
Configuration menu - View commit details
-
Copy full SHA for b5010d1 - Browse repository at this point
Copy the full SHA b5010d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13adef4 - Browse repository at this point
Copy the full SHA 13adef4View commit details -
Ch. 17 §04: explain yield better and rework examples
- Actually show “slow” work with interleaved await points in examples. - Explain in detail how the slow work and the await points interact.
Configuration menu - View commit details
-
Copy full SHA for 54a18a7 - Browse repository at this point
Copy the full SHA 54a18a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e56e906 - Browse repository at this point
Copy the full SHA e56e906View commit details -
Configuration menu - View commit details
-
Copy full SHA for 95422ab - Browse repository at this point
Copy the full SHA 95422abView commit details -
Ch. 17 §03: Add more explanatory material on
Pin
This is far from complete, but at least takes another reasonable step toward an explanation, while keeping the level of detail relatively manageable, I think.
Configuration menu - View commit details
-
Copy full SHA for b3931ef - Browse repository at this point
Copy the full SHA b3931efView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8809d9f - Browse repository at this point
Copy the full SHA 8809d9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 121f5b6 - Browse repository at this point
Copy the full SHA 121f5b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a97358e - Browse repository at this point
Copy the full SHA a97358eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 644bc54 - Browse repository at this point
Copy the full SHA 644bc54View commit details -
Configuration menu - View commit details
-
Copy full SHA for b796ff8 - Browse repository at this point
Copy the full SHA b796ff8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f786162 - Browse repository at this point
Copy the full SHA f786162View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39485b9 - Browse repository at this point
Copy the full SHA 39485b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 617b755 - Browse repository at this point
Copy the full SHA 617b755View commit details -
Ch. 17: reduce dependency list for
trpl
crateThis makes compiled output in listings much more reasonable. It may be worth seeing if we can trim it down even further. (Switching to `smol` would do that, I think, but would have other effects.)
Configuration menu - View commit details
-
Copy full SHA for 2360484 - Browse repository at this point
Copy the full SHA 2360484View commit details
Commits on Jun 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5458a6a - Browse repository at this point
Copy the full SHA 5458a6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 217645e - Browse repository at this point
Copy the full SHA 217645eView commit details -
Ch. 17: Finish (first pass) documentation for
trpl::race
Explain how it relates to `futures::future::select` and why `trpl` uses `race` semantics instead.
Configuration menu - View commit details
-
Copy full SHA for c310f54 - Browse repository at this point
Copy the full SHA c310f54View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69323d9 - Browse repository at this point
Copy the full SHA 69323d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc0ce20 - Browse repository at this point
Copy the full SHA dc0ce20View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccd6808 - Browse repository at this point
Copy the full SHA ccd6808View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c4ebb7 - Browse repository at this point
Copy the full SHA 4c4ebb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c41d8f - Browse repository at this point
Copy the full SHA 4c41d8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fd549d - Browse repository at this point
Copy the full SHA 6fd549dView commit details -
Ch. 17 §02: leave a TODO about one bucket of output
This one may or may not make sense: the output *order* should be the same regardless, but there will be a *lot* of extra noise in it because of the `cargo build` output before the actual program output, and we do not appear to have a good way to focus on particular subsets of output the way we do for code?
Configuration menu - View commit details
-
Copy full SHA for bd26083 - Browse repository at this point
Copy the full SHA bd26083View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d802a0 - Browse repository at this point
Copy the full SHA 6d802a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38ddc49 - Browse repository at this point
Copy the full SHA 38ddc49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 60cde00 - Browse repository at this point
Copy the full SHA 60cde00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e5b6f2 - Browse repository at this point
Copy the full SHA 7e5b6f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 766ad04 - Browse repository at this point
Copy the full SHA 766ad04View commit details -
Configuration menu - View commit details
-
Copy full SHA for c308400 - Browse repository at this point
Copy the full SHA c308400View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6035ba4 - Browse repository at this point
Copy the full SHA 6035ba4View commit details -
- Align them with the existing format for links. - Add one missing link.
Configuration menu - View commit details
-
Copy full SHA for a1eb8ae - Browse repository at this point
Copy the full SHA a1eb8aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 911167d - Browse repository at this point
Copy the full SHA 911167dView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8ecdb5 - Browse repository at this point
Copy the full SHA b8ecdb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b65e53 - Browse repository at this point
Copy the full SHA 2b65e53View commit details -
Ch. 17 §03: support code for motivating
Pin
- Rexport `tokio::fs::read_to_string` as `trpl::read_to_string`. - Add a no-listing example for the mutable borrow example. This will keep us honest that the code there itself compiles just fine!
Configuration menu - View commit details
-
Copy full SHA for 67bd0a0 - Browse repository at this point
Copy the full SHA 67bd0a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 686b3e4 - Browse repository at this point
Copy the full SHA 686b3e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91565da - Browse repository at this point
Copy the full SHA 91565daView commit details
Commits on Jun 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for fb683c9 - Browse repository at this point
Copy the full SHA fb683c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d8f2c5 - Browse repository at this point
Copy the full SHA 9d8f2c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f93e8b - Browse repository at this point
Copy the full SHA 4f93e8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d73e893 - Browse repository at this point
Copy the full SHA d73e893View commit details
Commits on Jun 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4598e2c - Browse repository at this point
Copy the full SHA 4598e2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0c24e2 - Browse repository at this point
Copy the full SHA c0c24e2View commit details -
Ch. 17: Add a new §05 on Stream and AsyncIterator
This pushes back the Tasks, Futures, and Threads discussion one more spot, to become §06.
Configuration menu - View commit details
-
Copy full SHA for 74df84e - Browse repository at this point
Copy the full SHA 74df84eView commit details
Commits on Jun 18, 2024
-
Ch. 17 S§02: introduce and explain
while let
syntax.This is actually the first time it appears in the book, to my great surprise! We will also need to update Chapter 19 to account for having introduced this form already, following the example for how it handles Chapter 6’s introduction of `if let`.
Configuration menu - View commit details
-
Copy full SHA for f0825ad - Browse repository at this point
Copy the full SHA f0825adView commit details -
Configuration menu - View commit details
-
Copy full SHA for a05c34e - Browse repository at this point
Copy the full SHA a05c34eView commit details
Commits on Jun 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ad360d7 - Browse repository at this point
Copy the full SHA ad360d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52c516c - Browse repository at this point
Copy the full SHA 52c516cView commit details
Commits on Jun 20, 2024
-
Ch. 17: Remove a now-properly-numbered listing
I moved this into dedicated listings appropriately but forgot to remove the original.
Configuration menu - View commit details
-
Copy full SHA for e3ab302 - Browse repository at this point
Copy the full SHA e3ab302View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd1a3f7 - Browse repository at this point
Copy the full SHA cd1a3f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf5e4aa - Browse repository at this point
Copy the full SHA bf5e4aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for e790c2c - Browse repository at this point
Copy the full SHA e790c2cView commit details -
Ch. 17 §05: describe how to use
Stream
s withIterator
sAlso start laying the foundation for (a) showing how that interacts with previous material, e.g. around slow operations; and (b) showing how it composes nicely with other async operations, e.g. timeouts, throttling, and (maybe!) even merging streams.
Configuration menu - View commit details
-
Copy full SHA for ce9b286 - Browse repository at this point
Copy the full SHA ce9b286View commit details
Commits on Jun 25, 2024
-
Ch. 17: final example for §05, with more re-exported streams
Use `IntervalStream` and `ReceiverStream` to show the composition of multiple streams, along with throttling and timeouts. This will also provide a useful foundation for discussing the relationships between futures, tasks, and threads in the final sections of the book, since you can accomplish the same basic API by simply substituting threads for tasks—but with different tradeoffs!
Configuration menu - View commit details
-
Copy full SHA for b4f5763 - Browse repository at this point
Copy the full SHA b4f5763View commit details -
Configuration menu - View commit details
-
Copy full SHA for e71b667 - Browse repository at this point
Copy the full SHA e71b667View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c6c32c - Browse repository at this point
Copy the full SHA 3c6c32cView commit details
Commits on Jun 26, 2024
-
Ch. 17 §06: Start discussing future/task/thread tradeoffs
- Reintroduce accidentally-dropped content. I meant to simply carry this over in 74df84e, but failed to, perhaps because I had `mdbook serve` running and it tries to be helpful about generating files which are referenced in `SUMMARY.md` but do not exist on disk. Either way, this is back now and we can use it to explain these concepts. - Start on an example showing how `thread::spawn` and `spawn_task` are basically interchangeable from an API POV, so that we can then see how they differ in terms of runtime consequences.
Configuration menu - View commit details
-
Copy full SHA for bea8557 - Browse repository at this point
Copy the full SHA bea8557View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8fe2d6 - Browse repository at this point
Copy the full SHA a8fe2d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for bdd8f3e - Browse repository at this point
Copy the full SHA bdd8f3eView commit details -
Ch. 17: Most of §06 drafted, needs a conclusion
- Added a discussion of the relationship between futures, tasks, and threads—I am not in love with it, but it is a starting point. - Moved the still-to-be-rewritten 'Parallelism and Concurrency' back to §01, where it can be rewritten after getting some feedback.
Configuration menu - View commit details
-
Copy full SHA for ffb2d1b - Browse repository at this point
Copy the full SHA ffb2d1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 63214c3 - Browse repository at this point
Copy the full SHA 63214c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6914bc4 - Browse repository at this point
Copy the full SHA 6914bc4View commit details
Commits on Jul 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e774613 - Browse repository at this point
Copy the full SHA e774613View commit details -
Ch. 17: Transition materials from Ch. 16 and into Ch. 18
- Rewrite the end of Ch. 16 to account for the fact that it no longer transitions to the OOP/etc. chapter. - Add a summary to the end of Ch. 17, pulling over a bunch of the text that was previously in the end of Ch. 16. - Rewrite the introduction to Ch. 17, for a more seamless shift from Ch. 16 and contextualizing async in the broader software ecosystem.
Configuration menu - View commit details
-
Copy full SHA for f039ca3 - Browse repository at this point
Copy the full SHA f039ca3View commit details -
[wip] Update listings for chapters 18–21 (prev. 17–20)
Tasks to be done: - [ ] Update all listing *output* to match what it should be for the version of Rust we are using at the time we actually merge this. - [ ] (Re-)Update all references to listings to be correct.
Configuration menu - View commit details
-
Copy full SHA for c1ea779 - Browse repository at this point
Copy the full SHA c1ea779View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fdd92c - Browse repository at this point
Copy the full SHA 5fdd92cView commit details
Commits on Jul 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f023032 - Browse repository at this point
Copy the full SHA f023032View commit details -
Configuration menu - View commit details
-
Copy full SHA for eec1745 - Browse repository at this point
Copy the full SHA eec1745View commit details -
Configuration menu - View commit details
-
Copy full SHA for e238342 - Browse repository at this point
Copy the full SHA e238342View commit details -
Ch. 17§02 initial edits on 'Counting'
Revise the text itself, of course; but also fold together Listings 04 and 05, which also lets us expand Listing 03 into two listings (which I did not do previously because I knew this kind of thing would come up later!).
Configuration menu - View commit details
-
Copy full SHA for 09b80f9 - Browse repository at this point
Copy the full SHA 09b80f9View commit details
Commits on Jul 3, 2024
-
Ch. 17§02 initial edits on 'Message Passing'
- The usual kinds of clarifications, cleaning up redundancies, etc. - Fold together listings: - 8 and 9 → 8 - 10, 11, 12 → 9 - 13 → 10 - 15 → 11 - 16 → 12 - Tweak the durations used for the listings throughout this section, including making the durations *differ* between the two sending blocks in the final example.
Configuration menu - View commit details
-
Copy full SHA for e5c9afd - Browse repository at this point
Copy the full SHA e5c9afdView commit details -
Ch. 17§03 Initial edits on opening section
Update the listings, eliminating them where possible and adding notes about manual regeneration as necessary. Also clean up a *lot* of issues with wording, phrasing, etc.!
Configuration menu - View commit details
-
Copy full SHA for 89920d5 - Browse repository at this point
Copy the full SHA 89920d5View commit details
Commits on Jul 8, 2024
-
Ch. 17§03 initial edits on pinning section
- Made a bunch of structural changes, including removing an entire unhelpful aside with an example that actually just confused things, and I *think* it is much more technically accurate *and* much easier to follow. - Updated the listings referenced within it for their new numberings, including deleting one per the above.
Configuration menu - View commit details
-
Copy full SHA for 451f77b - Browse repository at this point
Copy the full SHA 451f77bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1cc4dbe - Browse repository at this point
Copy the full SHA 1cc4dbeView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc0f913 - Browse repository at this point
Copy the full SHA cc0f913View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1030015 - Browse repository at this point
Copy the full SHA 1030015View commit details
Commits on Jul 9, 2024
-
Ch. 17§04 initial edits on Building Our Own Async Abstractions
Eliminate `trpl::timeout` entirely. Instead, just build the `timeout` directly (as the rest of the section already did). Restructure the listings as well, eliminating duplication and extraneous bits.
Configuration menu - View commit details
-
Copy full SHA for ef1ed96 - Browse repository at this point
Copy the full SHA ef1ed96View commit details
Commits on Jul 12, 2024
-
Ch. 17§05 initial edits on first two sections
- Flip the order, so that the semi-practical introduction comes first. - Merge several of the listings together. - The usual polishing and iterating on the text.
Configuration menu - View commit details
-
Copy full SHA for 074c442 - Browse repository at this point
Copy the full SHA 074c442View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a90722 - Browse repository at this point
Copy the full SHA 1a90722View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbcdb24 - Browse repository at this point
Copy the full SHA fbcdb24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2797d95 - Browse repository at this point
Copy the full SHA 2797d95View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92c19ce - Browse repository at this point
Copy the full SHA 92c19ceView commit details
Commits on Jul 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c3c88e4 - Browse repository at this point
Copy the full SHA c3c88e4View commit details
Commits on Jul 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 22b04c1 - Browse repository at this point
Copy the full SHA 22b04c1View commit details -
htypes! What are htypes? No one will ever know. Co-authored-by: James Munns <james@onevariable.com>
Configuration menu - View commit details
-
Copy full SHA for 58fff3c - Browse repository at this point
Copy the full SHA 58fff3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 130e6d0 - Browse repository at this point
Copy the full SHA 130e6d0View commit details
Commits on Jul 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for dc8d7e8 - Browse repository at this point
Copy the full SHA dc8d7e8View commit details -
Ch. 17: Update CI config to support testing the book with
trpl
mdBook does not currently have particularly good support for “external” crates. To make the test suite work correctly with `trpl`, we must first build `trpl` itself (`mdbook` will not do it), and then explicitly pass its `deps` path as a library search path for `mdbook test`. That will make sure all the crates can be resolved when running the tests. .github/workflows/main.yml
Configuration menu - View commit details
-
Copy full SHA for bb9cdbb - Browse repository at this point
Copy the full SHA bb9cdbbView commit details -
Ch. 17§01: Make code/listings pass tests
- Update the contents of the code in the chapter so it is correct, and update the text to match. Given this is about `Future`, this may also warrant moving/simplifying that whole chunk of code, too. - Update the listing to use `extern crate` since it does not otherwise work correctly with `mdbook test`. Alas.
Configuration menu - View commit details
-
Copy full SHA for 24ed6e4 - Browse repository at this point
Copy the full SHA 24ed6e4View commit details -
Ch. 17§02: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since `mdbook test` does not understand Rust 2018. Alas. - Ignore two of the listings because they never stop.
Configuration menu - View commit details
-
Copy full SHA for deefe4d - Browse repository at this point
Copy the full SHA deefe4dView commit details -
Ch. 17§03: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since `mdbook test` does not understand Rust 2018. Alas. - Fix one listing which had gotten out of sync somewhere along the way. (This also fixes a comment flagged up by a reviewer!)
Configuration menu - View commit details
-
Copy full SHA for 6a0d072 - Browse repository at this point
Copy the full SHA 6a0d072View commit details -
Ch. 17§04: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since `mdbook test` does not understand Rust 2018. Alas. - Ignore a listing which has a missing body apurpose.
Configuration menu - View commit details
-
Copy full SHA for 0aacb80 - Browse repository at this point
Copy the full SHA 0aacb80View commit details -
Ch. 17§05: Make code/listings pass tests
- Rewrite the `StreamExt` definition to be more correct, and extract it to a standalone “no-listing listing” so we can make sure its definition at least type checks. - Update all the listings in the chapter to use `extern crate` since `mdbook test` does not understand Rust 2018. Alas. - Ignore the listings (inline or otherwise!) which are *intended* not to compile, so mdbook does not try to test them. - Clarify some of the text around the *actual* Tokio definition of the `StreamExt::next` method.
Configuration menu - View commit details
-
Copy full SHA for 40bdda7 - Browse repository at this point
Copy the full SHA 40bdda7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5099e5f - Browse repository at this point
Copy the full SHA 5099e5fView commit details
Commits on Jul 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 45f1635 - Browse repository at this point
Copy the full SHA 45f1635View commit details -
Ch. 17: fix internal links with new ch. order
Note: this does *not* include all fixes for the text, only for the links themselves. For the text, we will also need to search for references to chapters 17-20. This catches a few of those along the way, but there are no doubt others.
Configuration menu - View commit details
-
Copy full SHA for 463b819 - Browse repository at this point
Copy the full SHA 463b819View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79fd5e2 - Browse repository at this point
Copy the full SHA 79fd5e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 644dbab - Browse repository at this point
Copy the full SHA 644dbabView commit details
Commits on Jul 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b2a2133 - Browse repository at this point
Copy the full SHA b2a2133View commit details -
Ch. 17§00: phrasing/wording-level improvements
Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz> Co-authored-by: James Munns <james@onevariable.com>
Configuration menu - View commit details
-
Copy full SHA for e669250 - Browse repository at this point
Copy the full SHA e669250View commit details -
Ch. 17§00: phrasing/wording-level improvements
Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com> Co-authored-by: Will Crichton <crichton.will@gmail.com> Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
Configuration menu - View commit details
-
Copy full SHA for 133bb61 - Browse repository at this point
Copy the full SHA 133bb61View commit details
Commits on Jul 24, 2024
-
Ch. 16: avoid slightly-dismissive language in transition
Use the original transitional paragraph and structure, adding to it instead of rewriting it entirely. HT @timClicks (Tim McNamara <paperless@timmcnamara.co.nz>) for pointing out how my rephrasing here made it worse!
Configuration menu - View commit details
-
Copy full SHA for 4044534 - Browse repository at this point
Copy the full SHA 4044534View commit details -
Ch. 17§00: rework the introduction based on initial reviews
- Drop the history lesson and comparisons to other approaches. Focus on what async gives us instead. - Simplify and clarify the - Talk about “the network” instead of “network sockets” and simplify the example code to match.
Configuration menu - View commit details
-
Copy full SHA for eb41efb - Browse repository at this point
Copy the full SHA eb41efbView commit details
Commits on Jul 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for cfaf187 - Browse repository at this point
Copy the full SHA cfaf187View commit details
Commits on Jul 26, 2024
-
Ch. 17: fix diagrams and embed them in the text
- Swap the ordering to match the order in the text (concurrent is first, at least for now). - Make them go left-to-right instead of top-to-bottom for compactness in the text. - Fix rendering issues resulting from the VS Code extension doing things that normal `dot` does not, for who knows what reasons.
Configuration menu - View commit details
-
Copy full SHA for 472f152 - Browse repository at this point
Copy the full SHA 472f152View commit details
Commits on Jul 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d039f75 - Browse repository at this point
Copy the full SHA d039f75View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce40557 - Browse repository at this point
Copy the full SHA ce40557View commit details