Skip to content

:producer_consumer doesn't invoke handle_demand #214

@toddkazakov

Description

@toddkazakov

When we have a producer->producer_consumer->consumer pipeline, producer_consumers ought to provide ability to "intercept" demand sent by consumers by overriding handle_demand. This will allow those stages to buffer consumer demand and only send the demand upstream when certain conditions are met (using GenStage.ask and :manual). Currently handle_demand is not invoked and when we have a :manual subscriptions it's not clear when consumers are ready to consume events.

I was trying to implement a reusable and pluggable producer_consumer rate-limiting stage, but was surprised that it doesn't work as I expected (in the past I have used akka-streams). Is there maybe another way to achieve this functionality?

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