Skip to content

Lack of parallelism in AsyncSeq.cache #95

@deneuxj

Description

@deneuxj

Description

I noticed that when multiple consumers use a cached AsyncSeq, the late ones delay reading cached items until the lead consumer receives a new item.

Repro steps

See the change to AsyncSeqTests.fs at
https://github.com/fsprojects/FSharp.Control.AsyncSeq/pull/94/files

Expected behavior

Second consumer should take close to no time to read all 5 cached items

Actual behavior

Second consumer can't proceed and read cached items until the first consumer has received the next, most recent item.

Known workarounds

None

Related information

Problem observed on .net 4.5 and .net core 2.0 on master. Also observed with NuGet package 2.0.21 with .net 4.5

See #94 for a suggested fix and test case.

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