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

Guide section: "Futures, Streams, and Sinks" #6

Closed
carllerche opened this issue Oct 1, 2018 · 1 comment
Closed

Guide section: "Futures, Streams, and Sinks" #6

carllerche opened this issue Oct 1, 2018 · 1 comment
Labels
guide Relates to an existing or missing guide.

Comments

@carllerche
Copy link
Member

carllerche commented Oct 1, 2018

Tracks overall discussion regarding the contents and structure of the "Futures, Streams, and Sinks" guide section.

Pages:

Overview

Status: Unassigned.

Futures were introduced in the getting started section. This page is a more in-depth guide into what a Future is conceptually, why it makes sense to represent async computations using futures. Then, it expand this into what Streams and Sinks are at a high level.

Contents

  • What is the difference between a future, stream, and sink?
  • Disclaimer: Tokio's futures are very different than what other languages provide.

Working with Futures

Status: Unassigned.

TODO: Description

Contents

  • Intro
    • Summarize the overview page
  • Combinators
    • What is a combinator?
    • What kind of combinators are there?
      • Survey of the various kinds of combinators and examples of how
        to use them.
    • Shortcomings of combinators (move by value, no borrowing).
    • Must write in a fully functional style.
    • Common patterns with futures
    • Reach often for custom combinators (implementing Future).
  • Implementing custom combinators
    • TODO: Good rule of thumb for when to reach for this
    • TODO: What are some good examples to work thorugh?
  • Tasks (vs. Futures)
    • Quick note, tasks are "just" a future representing the
      completion of the task's computation.
    • Common problem: Not mapping a future to Item = (), Error = ()

Working with Streams

Status: Unassigned.

TODO: Description

Content

  • More detailed description fo streams, when to use them.
    • Examples of types that implement stream.
  • Combinators.
    • What kind of combinators are there?
      • Survey of the various kinds of combinators and examples of how
        to use them.
  • Implementing custom combinators
    • TODO: What should go here?

Working with Sinks

Status: Unassigned.

TODO: Description

Contents

  • More detailed description fo streams, when to use them.
    • Examples of types that implement stream.
      • mpsc::Sender.
      • BytesCodec (hint at transports).
  • Combinators
    • Not as many combaintors, combinators make most sense on the
      "pull" side of things vs. push.
    • fanout, buffer
  • How to use Sink?
    • send, send_all, flush
  • Implementing Sink
    • Implement a basic channel (backed by a VecDeque)
    • How is Fanout implemented.

Putting it Together

Status: Unassigned.

TODO: Description

Contents

  • How to structure an application using Tokio?
    • Looping

TODO: Fill this out

Open questions

  • Where does the topic of cancellation fit in?
  • Can the section title be better?
@carllerche carllerche added the guide Relates to an existing or missing guide. label Oct 1, 2018
@carllerche
Copy link
Member Author

The outline is now tracked in the code (#22).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guide Relates to an existing or missing guide.
Projects
None yet
Development

No branches or pull requests

1 participant