-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add page abount flow control #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put it into grammarly too
|
||
- output pad with `flow_control: :manual` - the element gets the information, through the `handle_demand` callback, how much data a specific output pad needs. An element having an output pad with `:manual` `flow control` is obligated to satisfy the demand on it. | ||
|
||
- input pad with `flow_control: :auto` - since `v1.0.0-rc1` the default `flow control` value. Unlike in manual demands, the element must not directly specify the demand value on the input pad to receive buffers on it. In `:auto` `flow control`, the framework will manage the demand value itself. In the case of Sources and Endpoints, it will make sure that the demand on the input pad is positive as long as the number of buffers waiting for processing in the mailbox is not too large. In the case of filters, Membrane will take care of a positive demand on under one additional condition - the demand value on all output pads with `flow_control: :auto` of this element must also be positive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mention the new defaults until we have 1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- input pad with `flow_control: :auto` - since `v1.0.0-rc1` the default `flow control` value. Unlike in manual demands, the element must not directly specify the demand value on the input pad to receive buffers on it. In `:auto` `flow control`, the framework will manage the demand value itself. In the case of Sources and Endpoints, it will make sure that the demand on the input pad is positive as long as the number of buffers waiting for processing in the mailbox is not too large. In the case of filters, Membrane will take care of a positive demand on under one additional condition - the demand value on all output pads with `flow_control: :auto` of this element must also be positive. | |
- input pad with `flow_control: :auto` - since `v1.0.0-rc1` the default `flow control` value. Unlike in manual demands, the element doesn't have to directly specify the demand value on the input pad to receive buffers on it. In `:auto` `flow control`, the framework will manage the demand value itself. In the case of Sources and Endpoints, it will make sure that the demand on the input pad is positive as long as the number of buffers waiting for processing in the mailbox is not too large. In the case of filters, Membrane will take care of a positive demand on under one additional condition - the demand value on all output pads with `flow_control: :auto` of this element must also be positive. |
|
||
- output pad with `flow_control: :push` - the element decides for itself when to send how many buffers via a given pad. | ||
|
||
- input pad with `flow_control: :manual` - the element directly, using the `demand` action, determines how much data it wants to receive from this pad. Membrane guarantees that more data will never come to the input pad than was demanded.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- input pad with `flow_control: :manual` - the element directly, using the `demand` action, determines how much data it wants to receive from this pad. Membrane guarantees that more data will never come to the input pad than was demanded.. | |
- input pad with `flow_control: :manual` - the element directly, using the `demand` action, requests how much data it wants to receive from this pad. Membrane guarantees that more data will never come to the input pad than was demanded. |
|
||
- input pad with `flow_control: :auto` - since `v1.0.0-rc1` the default `flow control` value. Unlike in manual demands, the element must not directly specify the demand value on the input pad to receive buffers on it. In `:auto` `flow control`, the framework will manage the demand value itself. In the case of Sources and Endpoints, it will make sure that the demand on the input pad is positive as long as the number of buffers waiting for processing in the mailbox is not too large. In the case of filters, Membrane will take care of a positive demand on under one additional condition - the demand value on all output pads with `flow_control: :auto` of this element must also be positive. | ||
|
||
- output pad with `flow_control: :output` - an auto output pad does not require from the element to implement the `handle_demand` callback. The demand value on this pad only matters when the framework itself calculates the value of the auto demand on the input pads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- output pad with `flow_control: :output` - an auto output pad does not require from the element to implement the `handle_demand` callback. The demand value on this pad only matters when the framework itself calculates the value of the auto demand on the input pads. | |
- output pad with `flow_control: :auto` - an auto output pad does not require from the element to implement the `handle_demand` callback. The demand value on this pad only matters when the framework itself calculates the value of the auto demand on the input pads. |
|
||
- input pad with `flow_control: :manual` - the element directly, using the `demand` action, determines how much data it wants to receive from this pad. Membrane guarantees that more data will never come to the input pad than was demanded.. | ||
|
||
- output pad with `flow_control: :manual` - the element gets the information, through the `handle_demand` callback, how much data a specific output pad needs. An element having an output pad with `:manual` `flow control` is obligated to satisfy the demand on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- output pad with `flow_control: :manual` - the element gets the information, through the `handle_demand` callback, how much data a specific output pad needs. An element having an output pad with `:manual` `flow control` is obligated to satisfy the demand on it. | |
- output pad with `flow_control: :manual` - the element gets the information, through the `handle_demand` callback, how much data a specific output pad needs. An element having an output pad with `flow control: :manual` is obligated to satisfy the demand on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's add an example of when manual demands are needed
|
||
When defining a pad od an element, you can pass one of 3 values in the `flow_control` field: `auto`, `push`, or `manual`. They determine how the backpressure mechanism works on the pad they relate to. | ||
|
||
- input pad with `flow_control: :push` - an element with such a pad must always be ready to receive a new buffer on that pad. The output pad linked with such a input pad must also have `flow control` set to `:push`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's start with capital letters
|
||
When defining a pad od an element, you can pass one of 3 values in the `flow_control` field: `auto`, `push`, or `manual`. They determine how the backpressure mechanism works on the pad they relate to. | ||
|
||
- input pad with `flow_control: :push` - an element with such a pad must always be ready to receive a new buffer on that pad. The output pad linked with such a input pad must also have `flow control` set to `:push`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd mention that it's usually not advised to use push input, as it's prone to overflow
baaa645
to
46f829d
Compare
- `manual`, these buffers will wait in line until the element raises the demand on its input by returning the `demand` action. | ||
- `auto`, these buffers will be processed, and the demand value on the input pad will drop below zero. | ||
|
||
In both of the above cases, when much more data is sent than was demanded on the input pad, a `toilet overflow` error will be thrown. It means that the element with the push output pad sends more data than the rest of the pipeline can process. We can control the limit value, above which the `toilet overflow` error will be thrown, using the `toilet_capacity` option passed to the `via_in/3` function when creating the spec, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only true if the effective flow control is pull
6337ae7
to
35d9bbe
Compare
35d9bbe
to
d5f5dfc
Compare
Related Jira ticket: https://membraneframework.atlassian.net/browse/MC-231