Skip to content
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

Breaking changes in 6.0.0 #761

Closed
jpdillingham opened this issue Oct 16, 2022 · 0 comments · Fixed by #772
Closed

Breaking changes in 6.0.0 #761

jpdillingham opened this issue Oct 16, 2022 · 0 comments · Fixed by #772

Comments

@jpdillingham
Copy link
Owner

jpdillingham commented Oct 16, 2022

Breaking Changes

#760 Use async delegates for stream factory parameters in UploadAsync() and DownloadAsync()

Previously callers could supply a streamFactory delegate to UploadAsync() and DownloadAsync(), which would be used to defer opening of streams until just before sending or receiving transfer data. The use case is the same, but now the factory method is async, and the factory method call is awaited. This is beneficial for cases where network I/O is used, and eliminates the need for blocking waits if async code was used with the sync factory.

Any code broken by this can be fixed by wrapping the existing return value in Task.FromResult(<the old value>).

#765 Pass the requested start offset for uploads to the input stream factory function

In some cases, the source of input streams will need to do some extra manipulation to prepare the input stream and position the data correctly to support resume-able transfers. In these cases the code supplying the stream to the input stream factory needs to know the desired offset, and it is now passed to the factory function..

The signature of the input stream factory has changed from Func<Task<Stream>> to Func<long, Task<Stream>> to allow the offset to be passed.

Code broken by this change can be fixed by accounting for the long parameter passed to this factory function; it can be discarded.

#768 Deprecate all code that attempts to treat the 'free upload slot' property of search results as an integer instead of a boolean

The property FreeUploadSlots has been removed from SearchResponse, and MinimumPeerFreeUploadSlots has been removed from SearchOptions.

Instead of FreeUploadSlots, HasFreeUploadSlot should be used.

Any code using MinimumPeerFreeUploadSlots should be deleted; there is no replacement property, but code can implement the ResponseFilter delegate using something like (response) => response.HasFreeUploadSlot.

#770 Rename the responseReceived parameter of SearchAsync to responseHandler

This is a naming-only change to make this more consistent with the rest of the API, and to disambiguate the functionality from the ResponseReceived property of SearchOptions.

Any code broken by this can simply rename the existing responseReceived reference to responseHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant