Skip to content

Why does Body need to be Sync? #2159

@rkuhn

Description

@rkuhn

In https://github.com/hyperium/hyper/pull/2048/files#diff-8fd688c7233290bc8ae01519ef707f1eR58 the Body was changed to require a Sync bound. This trickles down into Body::wrap_stream, which now requires the Stream to be Sync as well. A Stream struct basically is the description of a task out of which elements can be pulled. Requiring this task to be Sync amounts to saying that the poll_next function needs to be reentrant, but that runs counter to its signature which promises a &mut self reference (i.e. an exclusive reference). Somewhere in here something is broken, could you enlighten me exactly where the breakage lies?

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