Skip to content

Flow extension potentially dropping messages #113

Open
@nomisRev

Description

@nomisRev

uses trySend which might drop the message.

If I'm not mistaken the Reactor implementation relies on an unbounded buffer under the hood, but that is not the case for KotlinX Flow. The buffered callbackFlow has a buffer size of 64 by default.

You could set an explicit buffer size of UNBOUNDED but the user can overwrite with the buffer operator, so that would have to be avoided by preventing that or it should use trySendBlocking instead.

I think back pressuring the LLM messages makes no sense, so an unbounded buffer size is probably desired. If desired I can provide a PR with a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions