Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update the book tutorial to use async_std channels #398

Open
Assignees
Labels
documentationImprovements or additions to documentation
@yoshuawuyts

Description

With #380 landed, we should update the tutorial to use them. This would remove the final dependency on futures-rs (and importantly: Sink) which should be a big step up in terms of usability.

Also we should consider moving from select! {} to Stream::merge. From chat with @skade we've figured out how to "send a close message after a stream has been exhausted":

enum EventKind {
 Event(/* event_type */),
 Shutdown,
}
let events = events.map(|ev| EventKind::Event(ev)).join(stream::once(EventKind::Shutdown));
let shutdown = shutdown.map(|e| EventKind::Event(e));
let s = events.merge(shutdown);
while let Some(event) = s.next().await {
 match event {
 EventKind::Event(ev) => /* handle event */,
 EventKind::Shutdown => /* handle shutdown */,
 }
}

@skade I'm assigning this to you as you've been working on updating this recently. Feel free to unassign yourself if you don't think you'll have bandwidth. Thanks!

edit: this would resolve #105 and #13

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /