Skip to content

Improve :redemand DX #1087

@kidq330

Description

@kidq330
  1. While it often helps that :redemand is allowed to be returned in handle_demand by Sources and Endpoints (as opposed to Filters), it can very easily turn into an infinite loop. It would be helpful to at least emit a warning log after a 1000 subsequent calls or so.
  2. The docs don't explicitly note that :redemand is forbidden in Filter handle_demand, with an unintuitive error when it is returned. An example of running into this limitation without a clear reason is e.g. changing a Membrane.Endpoint into a Membrane.Filter which previously used :redemand in handle_demand (with logic that avoids infinite loops). The error looks as follows:
11:32:39.023 [error] <0.168.0>/:filter Error handling action returned by callback MyFilter.handle_demand.
Action: {:redemand, :output}


11:32:39.024 [error] <0.168.0>/:filter Error occured in Membrane Element:
** (Membrane.ActionError) Error while handling action {:redemand, :output}
We looked everywhere, but couldn't find out what this action is supposed to do.
Make sure it's correct and valid for the component, its playback, callback or
other possible circumstances. See the docs for Membrane.Element.Action to check
which actions are supported and when you can return them.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions