-
Notifications
You must be signed in to change notification settings - Fork 39
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
Write upgrading guide for v1.0.0 #646
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FelonEkonom
added
the
no-changelog
This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md
label
Oct 16, 2023
FelonEkonom
force-pushed
the
v1.0.0-upgrading-guide
branch
from
October 16, 2023 14:26
f70b2e0
to
b205a81
Compare
mat-hek
reviewed
Oct 17, 2023
guides/upgrading/v1.0.0.md
Outdated
Comment on lines
19
to
46
There is no more `:playback` action available, as the pipeline will start playing automatically once its setup is completed. | ||
If you need to start the pipeline as soon as possible, simply do not return the `:playback` action in `c:Membrane.Pipeline.handle_init/2` or `c:Membrane.Pipeline.handle_setup/2` callbacks: | ||
```diff | ||
@impl true | ||
def handle_setup(_ctx, state) do | ||
... | ||
- {[playback: :playing], state} | ||
+ {[], state} | ||
end | ||
``` | ||
In case you need to defer the moment the pipeline starts playing, and for this purpose you have returned `:playback` action in some other callback than `handle_init` or `handle_setup`, now you need to do two things - first, mark the setup as incomplete with `t:Membrane.Pipeline.Action.setup/0` action returned from `handle_setup`, to prevent it from automatically changing the playback to `:playing`: | ||
|
||
```diff | ||
+ @impl true | ||
+ def handle_setup(_ctx, state) do | ||
+ {[setup: :incomplete], state} | ||
+ end | ||
``` | ||
|
||
Then, you need to return `setup: :complete` instead of `playback: :playing` action in a callback after which completion you want your pipeline to start playing: | ||
```diff | ||
@impl true | ||
def handle_info(:now_start_playing, _ctx, state) do | ||
... | ||
- {[playback: playing], state} | ||
+ {[setup: :complete], state} | ||
end | ||
``` |
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 guess this was already introduced in 0.12 🤔 https://hexdocs.pm/membrane_core/0.12.9/v0-12.html#remove-playback-action
Co-authored-by: Mateusz Front <[email protected]>
mat-hek
approved these changes
Oct 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
no-changelog
This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This guide is mostly made of pieces of upgrading guides for
v1.0.0-rc0
andv1.0.0-rc1