-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write upgrading guide for v1.0.0-rc1 (#625)
- Loading branch information
1 parent
fd16779
commit 4d4283d
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Upgrading to v1.0.0-rc1 | ||
|
||
### Remove `handle_buffers_batch/4`/`handle_process_list/4`/`handle_write_list/4` callback | ||
|
||
In `v1.0.0-rc1` we removed `handle_buffers_batch/4` callback. Instead of handling list of buffer in this callback, you have to handle every single buffer separately in `hanlde_buffer/4` callback. | ||
|
||
```diff | ||
@impl true | ||
- def handle_buffers_batch(pad_ref, buffers_list, ctx, state) do | ||
+ def handle_buffer(pad_ref, buffer, ctx, state) do | ||
... | ||
end | ||
``` | ||
|
||
Notice, if you are upgrading your code from `v0.12.*` directly to `v1.0.0-rc1`, omitting `v1.0.0-rc0`, there is a chance, that your elements still have callback named `handle_process_list/4` or `handle_write_list/4`, instead of `handle_buffers_batch/4`. | ||
|
||
```diff | ||
@impl true | ||
- def handle_process_list(pad_ref, buffers_list, ctx, state) do | ||
+ def handle_buffer(pad_ref, buffer, ctx, state) do | ||
... | ||
end | ||
``` | ||
|
||
```diff | ||
@impl true | ||
- def handle_write_list(pad_ref, buffers_list, ctx, state) do | ||
+ def handle_buffer(pad_ref, buffer, ctx, state) do | ||
... | ||
end | ||
``` | ||
|
||
### Implement you own `start/*`, `start_link/*` or `terminate/1` function (if you want to) | ||
|
||
Until `v1.0.0-rc0`, Membrane has generated `start/2`, `start_link/2`, and `terminate/1` functions in modules using `Membrane.Pipeline`, if code developer hadn't done it explicitly. Since `v1.0.0-rc1`, if you want to have these functions implemented in your pipeline module, you have to implement them on your own. Alternatively, you can always call `Membrane.Pipeline.start(YourPipelineModule, init_arg, opts)`, `Membrane.Pipeline.start_link(YourPipelineModule, init_arg, opts)`, and `Membrane.Pipeline.terminate(pipeline_pid)` from beyond `YourPipelineModule` without wrapping it into public functions. | ||
|
||
### Rename `:structure` option passed to the `Membrane.Testing.Pipeline` into `:spec` | ||
|
||
```diff | ||
import Membrane.ChildrenSpec | ||
|
||
spec = | ||
child(:source, %Membrane.Testing.Source{some_field: some_arg}) | ||
|> child(:sink), %Membrane.Testing.Sink{another_filed: another_arg} | ||
|
||
- pipeline = Membrane.Testing.Pipeline.start_link_supervised(structure: spec) | ||
+ pipeline = Membrane.Testing.Pipeline.start_link_supervised(spec: spec) | ||
``` |
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