Fix #395 : SftpClient Enumerates Rather Than Accumulates Directory Items#396
Fix #395 : SftpClient Enumerates Rather Than Accumulates Directory Items#396znamenap wants to merge 2 commits intosshnet:developfrom
Conversation
… Than Accumulates Directory Items
dc7c792 to
57adbee
Compare
… Than Accumulates Directory Items
|
Hi, |
|
This PR is ready to review and approve potentially. |
|
I like the change, but I don't think we should add a new method for it. Instead, we should just change I also think we should remove the What do you think @WojciechNagorski ? |
|
My two cents two the discussion regarding changing the internal implementation of the ListDirectory, changing it to use the yield return will certainly break the existing consumer's business logic with the unwritten behavior of returing a complete list in fact. Many of the consumers had already implemented logic such way they are in fact expecting the full list. Therefore, I'd rather suggest changing ListDirectory to return IList interface as part of the major breaking changes and do not introduce the yield return at all. If consumers would like to change the behavior, they can simply change the call from ListDirectory to EnumerateDirectory. |
|
Regarding the callback, I second that idea, the thread pool may be in excess. I presume the callback was added in order to report the progress and hence, I'm suggesting this may be replaced with |
Hi @drieseng ,
Please, could you check this pull request for #395 ?
The enumerating directory approach has better time results on very huge directorries (a lot of files meaning 80000). In many situations happened the call timed out while using the actual method ListDirectory.
I've also tested in my test environment and the same tests as like in ListDirectory.
Thanks.
Pavel