Cleanup source.dynamic, fix append
#4156
Merged
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 PR does some cleanup of
source.dynamic
after debuggingappend
:In particular, it removes the
set
method andresurection_time
parameter.resurection_time
was never used in the code base and creates weird issues when passing sources that are less long than the given time.I believe that a good general rule is that
source.dynamic
is powerful and the user should be careful to control the kind of issues thatresurection_time
was supposed to automatically take care of.The semantics for
set
is not clear: does it change the source immediately? Following thetrack_sensitive
param?Its effect can always be implemented using the next source callback, which is what that PR does.
It also fixes a bug: sources should be put to
sleep
after being used insource.dynamic
as they can be re-used elsewhere or later in the operator.A convenience methods is added that makes it possible to prepare a source before it is given to
source.dynamic
, for instance when creating it at the beginning of a track and returning it at its end.This makes it possible to fetch request, etc. to have the maximum chance of being ready when the source is used.
merge
is added as a getter, making it possible to selectively merge tracks when switching sources.The operator is also no longer marked
experimental
. It supports all thesingle
and more at this point so it makes sens to give it more visibility.Lastly,
append
is rewritten and fixed using these new APIs.