Skip to content

Documentation: Misleading comment in event driven discovery #460

@Finomnis

Description

@Finomnis

Specifically those lines:

    // Print based on whatever the event receiver outputs. Note that the event
    // receiver blocks, so in a real program, this should be run in its own
    // thread (not task, as this library does not yet use async channels).
    while let Some(event) = events.next().await {

This comment is probably a relic from a time where instead of events.next().await there was a blocking call, right?

I can hardly imagine that events.next().await requires its own thread; this thread would require a new async reactor because it can no longer process .await calls. So I'm highly suspicious of this comment.

Also, the fact that events is some implementation of futures_core::stream::Stream, I question the validity of does not yet use async channels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions