Skip to content

Impl Sink for With should buffer the items #1834

@hosyvietanh

Description

@hosyvietanh

I recently faced an issue when using Sink to send websocket messages.
I used sink.with in order to modify the msg before actually sending it. The items are not buffered which caused some messages being lost.
https://github.com/rust-lang-nursery/futures-rs/blob/e9cd539cc977fda701f6f4679ee435fa66986ed8/futures-util/src/sink/with.rs#L171

I'm not sure if I understand the purpose of with correctly, but I think it should buffer the items when calling start_send instead of replacing the old ones.

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