snivilised / extendio

🐋 extentions to Go standard io library
MIT License
1 stars 0 forks source link

implement directory sampling #369

Closed plastikfan closed 11 months ago

plastikfan commented 11 months ago

The reason for this requirement is that a client might want to achieve a file sampling operation, whereby the client callback is only called back for let's say the first 3 files per directory.

But actually, a cleaner way to implemet this is to define this functionality explicitly within the navigator instead of expecting the client to do this. This would also alleviate synchronisation issues when navigation is proceeding on a parallel basis; ie the client would have to maintain some shared state this would need to be synchronised. We can ease this by implementing this directly with the aid of a new option setting and this would not need to be synchronised because the navigation operation itself is sequential; ie navigates the directory tree creating jobs which are posted to an internal worker pool.

Define a SampleSize in options somewhere

plastikfan commented 11 months ago

tidied up extendio xi18n/i18n imports

plastikfan commented 11 months ago

oops I forgot to add unit tests for directories with files, will submit another commit to cover this ...