Skip to content
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

Draft
wants to merge 192 commits into
base: main
Choose a base branch
from

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    0ec7296 View commit details
    Browse the repository at this point in the history
  2. Add Tokio dependency

    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.
    chriskrycho committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    fcd470c View commit details
    Browse the repository at this point in the history
  3. Re-export tokio::main as trpl::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!)
    chriskrycho committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    3943e51 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e518289 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    608c35b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    71ea12e View commit details
    Browse the repository at this point in the history
  7. Add a CI status badge

    chriskrycho committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    4255d87 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    7c40849 View commit details
    Browse the repository at this point in the history
  2. Ch. 17: introduction section

    chriskrycho authored and carols10cents committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    c1a0d14 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d17c712 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4ce722d View commit details
    Browse the repository at this point in the history
  5. 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.
    chriskrycho authored and carols10cents committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    71d92ec View commit details
    Browse the repository at this point in the history
  6. Ch. 17: Introduce runtimes and the trpl crate

    Add 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.
    chriskrycho authored and carols10cents committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    fdb3794 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    cf00f05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    02b0bd1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    94d95c6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b4bcb2c View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Configuration menu
    Copy the full SHA
    63baf22 View commit details
    Browse the repository at this point in the history
  2. 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.
    chriskrycho committed May 9, 2024
    Configuration menu
    Copy the full SHA
    c31d308 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0721b04 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dee7220 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5b3c27e View commit details
    Browse the repository at this point in the history
  6. Ch. 17: use trpl, not futures, 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`.
    chriskrycho committed May 9, 2024
    Configuration menu
    Copy the full SHA
    ebebf8c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ee0704d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    40df049 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a150365 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. Configuration menu
    Copy the full SHA
    45bda34 View commit details
    Browse the repository at this point in the history
  2. 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.
    chriskrycho committed May 10, 2024
    Configuration menu
    Copy the full SHA
    8f6bcc7 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. Configuration menu
    Copy the full SHA
    0c00b17 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    23027cb View commit details
    Browse the repository at this point in the history
  3. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    3cf4fae View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c3ebabe View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5657a49 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dbd5e14 View commit details
    Browse the repository at this point in the history
  7. 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”.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    b4e3030 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    96fd725 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    95105d2 View commit details
    Browse the repository at this point in the history
  10. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    f418ceb View commit details
    Browse the repository at this point in the history
  11. 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!
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8e7420e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1ee7975 View commit details
    Browse the repository at this point in the history
  13. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    9c1f4c8 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    dacddb5 View commit details
    Browse the repository at this point in the history
  15. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    c1c3c7f View commit details
    Browse the repository at this point in the history
  16. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    4b7886e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    b835c07 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5e09f02 View commit details
    Browse the repository at this point in the history
  19. Exclude trpl from workspace

    It should manage its own dependencies.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    5483299 View commit details
    Browse the repository at this point in the history
  20. Ch. 17: skip main and trpl::block_on in some listings

    Wherever it makes sense to elide these for the sake of clarity, do so!
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    acde825 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    7b14d7d View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    89b3b25 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    1d7c987 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    1db4ee2 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    af18d2b View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    b3fe5b7 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    c1847bf View commit details
    Browse the repository at this point in the history
  28. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    1010b1f View commit details
    Browse the repository at this point in the history
  29. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8ce6c8a View commit details
    Browse the repository at this point in the history
  30. 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?
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    52bf9e4 View commit details
    Browse the repository at this point in the history
  31. Ch. 17: dedicate §03 to 'Futures, Tasks, and Threads'

    - Move the heading out from §03.
    - Add this to the summary.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    3224ceb View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    82f47c3 View commit details
    Browse the repository at this point in the history
  33. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    91ffec8 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    d3d7c64 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    91348ca View commit details
    Browse the repository at this point in the history
  36. Ch 17.02: motivating futures::join! and Box::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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    068f30b View commit details
    Browse the repository at this point in the history
  37. Ch. 17: finish motivating Pin and pin!

    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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    7a5bdb2 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    626aec8 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    40a3dc1 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    b382767 View commit details
    Browse the repository at this point in the history
  41. Ch. 17: Iterate on explanation of Pin and Unpin

    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
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    e000ea3 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    0032e07 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    4236371 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    97f5bcc View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    888a519 View commit details
    Browse the repository at this point in the history
  46. Ch. 17 §02: Start showing timeouts

    This also has the setup for showing `select`, but currently jumps ahead
    to showing a `timeout` example.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    c6965ca View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    c58f943 View commit details
    Browse the repository at this point in the history
  48. Ch. 17 §02: Implement timeout example and building blocks

    Create 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    7da440a View commit details
    Browse the repository at this point in the history
  49. Ch. 17: build a retry implementation

    This 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
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    270780a View commit details
    Browse the repository at this point in the history
  50. Ch. 17: Drop material about retry, since it is a hazard

    As 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
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    1c27c97 View commit details
    Browse the repository at this point in the history
  51. Ch. 17 §02: Write about race and yield_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`.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    71acd6d View commit details
    Browse the repository at this point in the history
  52. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    5a0fb42 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    86835d6 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    a364865 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    f4cd9d2 View commit details
    Browse the repository at this point in the history
  56. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    b5010d1 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    13adef4 View commit details
    Browse the repository at this point in the history
  58. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    54a18a7 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    e56e906 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    95422ab View commit details
    Browse the repository at this point in the history
  61. 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.
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    b3931ef View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    8809d9f View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    121f5b6 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    a97358e View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    644bc54 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    b796ff8 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    f786162 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    39485b9 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    617b755 View commit details
    Browse the repository at this point in the history
  70. Ch. 17: reduce dependency list for trpl crate

    This 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.)
    chriskrycho committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    2360484 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. Configuration menu
    Copy the full SHA
    5458a6a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    217645e View commit details
    Browse the repository at this point in the history
  3. Ch. 17: Finish (first pass) documentation for trpl::race

    Explain how it relates to `futures::future::select` and why `trpl` uses
    `race` semantics instead.
    chriskrycho committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    c310f54 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    69323d9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dc0ce20 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ccd6808 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4c4ebb7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4c41d8f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6fd549d View commit details
    Browse the repository at this point in the history
  10. 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?
    chriskrycho committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    bd26083 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6d802a0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    38ddc49 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    60cde00 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7e5b6f2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    766ad04 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c308400 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6035ba4 View commit details
    Browse the repository at this point in the history
  18. Ch. 17: Fix internal links

    - Align them with the existing format for links.
    - Add one missing link.
    chriskrycho committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a1eb8ae View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    911167d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    b8ecdb5 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    2b65e53 View commit details
    Browse the repository at this point in the history
  22. 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!
    chriskrycho committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    67bd0a0 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    686b3e4 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    91565da View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. Configuration menu
    Copy the full SHA
    fb683c9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d8f2c5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4f93e8b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d73e893 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Configuration menu
    Copy the full SHA
    4598e2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0c24e2 View commit details
    Browse the repository at this point in the history
  3. 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.
    chriskrycho committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    74df84e View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. 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`.
    chriskrycho committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    f0825ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a05c34e View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    ad360d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52c516c View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2024

  1. Ch. 17: Remove a now-properly-numbered listing

    I moved this into dedicated listings appropriately but forgot to remove
    the original.
    chriskrycho committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    e3ab302 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cd1a3f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bf5e4aa View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e790c2c View commit details
    Browse the repository at this point in the history
  5. Ch. 17 §05: describe how to use Streams with Iterators

    Also 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.
    chriskrycho committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    ce9b286 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2024

  1. 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!
    chriskrycho committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    b4f5763 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e71b667 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c6c32c View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2024

  1. 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.
    chriskrycho committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    bea8557 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8fe2d6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bdd8f3e View commit details
    Browse the repository at this point in the history
  4. 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.
    chriskrycho committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    ffb2d1b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    63214c3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6914bc4 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    e774613 View commit details
    Browse the repository at this point in the history
  2. 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.
    chriskrycho committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    f039ca3 View commit details
    Browse the repository at this point in the history
  3. [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.
    chriskrycho committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    c1ea779 View commit details
    Browse the repository at this point in the history
  4. Ch. 17§00 initial edits

    chriskrycho committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    5fdd92c View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Configuration menu
    Copy the full SHA
    f023032 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eec1745 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e238342 View commit details
    Browse the repository at this point in the history
  4. 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!).
    chriskrycho committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    09b80f9 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. 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.
    chriskrycho committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    e5c9afd View commit details
    Browse the repository at this point in the history
  2. 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.!
    chriskrycho committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    89920d5 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. 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.
    chriskrycho committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    451f77b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1cc4dbe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cc0f913 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1030015 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. 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.
    chriskrycho committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    ef1ed96 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. 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.
    chriskrycho committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    074c442 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a90722 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fbcdb24 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2797d95 View commit details
    Browse the repository at this point in the history
  5. Ch. 17§06 initial edits

    chriskrycho committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    92c19ce View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. Configuration menu
    Copy the full SHA
    c3c88e4 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. Configuration menu
    Copy the full SHA
    22b04c1 View commit details
    Browse the repository at this point in the history
  2. Ch. 17§03: fix typo

    htypes! What are htypes? No one will ever know.
    
    Co-authored-by: James Munns <james@onevariable.com>
    chriskrycho and jamesmunns committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    58fff3c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    130e6d0 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Configuration menu
    Copy the full SHA
    dc8d7e8 View commit details
    Browse the repository at this point in the history
  2. 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
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    bb9cdbb View commit details
    Browse the repository at this point in the history
  3. 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.
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    24ed6e4 View commit details
    Browse the repository at this point in the history
  4. 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.
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    deefe4d View commit details
    Browse the repository at this point in the history
  5. 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!)
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    6a0d072 View commit details
    Browse the repository at this point in the history
  6. 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.
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    0aacb80 View commit details
    Browse the repository at this point in the history
  7. 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.
    chriskrycho committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    40bdda7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5099e5f View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Configuration menu
    Copy the full SHA
    45f1635 View commit details
    Browse the repository at this point in the history
  2. 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.
    chriskrycho committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    463b819 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    79fd5e2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    644dbab View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2024

  1. Configuration menu
    Copy the full SHA
    b2a2133 View commit details
    Browse the repository at this point in the history
  2. Ch. 17§00: phrasing/wording-level improvements

    Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
    Co-authored-by: James Munns <james@onevariable.com>
    3 people committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    e669250 View commit details
    Browse the repository at this point in the history
  3. 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>
    4 people committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    133bb61 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. 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!
    chriskrycho committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    4044534 View commit details
    Browse the repository at this point in the history
  2. 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.
    chriskrycho committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    eb41efb View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Configuration menu
    Copy the full SHA
    cfaf187 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. 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.
    chriskrycho committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    472f152 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    d039f75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce40557 View commit details
    Browse the repository at this point in the history