Early error checking and file name generation for FileSink #1430
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.
FileSink
writers are used when file creation needs to be deferred until the first element of the observable sequence is provided (e.g. if opening the writer requires knowing the size of a video frame).Previously, all checks on file name were deferred until this moment. However, for improved consistency with support for early binding of file name provided by #1377, this PR moves most of the checks earlier in the observable lifetime, so that it does not become necessary to wait until a value is finally produced to detect an error in the specified file name. For example, the arrival of the first element can take several hours for infrequent events and can be frustrating to find out only at that time that we forgot to provide a non-empty file name.