feat(Directory): Add EnumLinksAsync method#39
Conversation
schomatis
left a comment
There was a problem hiding this comment.
I'll take a closer look at the end of the week (left some comments for now) but this makes plenty of sense. 👍
io/directory.go
Outdated
| go func() { | ||
| defer close(linkResults) | ||
| for _, l := range d.node.Links() { | ||
| linkResults <- format.LinkResult{ |
There was a problem hiding this comment.
This should also select on ctx to avoid leaking goroutines (same in other places)
There was a problem hiding this comment.
got it. will do.
cfc13dc to
6ec34f8
Compare
| format "github.com/ipfs/go-unixfs" | ||
| "github.com/spaolacci/murmur3" | ||
|
|
||
| format "github.com/ipfs/go-unixfs" |
io/directory.go
Outdated
|
|
||
| // EnumLinksAsync returns a channel which will receive Links in the directory | ||
| // as they are enumerated, where order is not gauranteed | ||
| func (d *BasicDirectory) EnumLinksAsync(ctx context.Context) (<-chan format.LinkResult, error) { |
There was a problem hiding this comment.
I'd drop the error from the signature since it's not used here (or other impls of this function)
- Add LinkResult type to unix-fs - is an ipld Link or an error - Add EnumLinksAsync method to Directory interface, returns channel of directory links or error - Add EnumLinksAsync method to Shard interface in HAMT, returns channel of directory links or error - EnumLinks method in Shard interface in HAMT uses EnumLinksAsync now - modify makeAsyncTrieGetLinks to use channel
eee76dd to
c54d0e4
Compare
|
@schomatis are you good with my responses? Can we go ahead and merge this PR? |
schomatis
left a comment
There was a problem hiding this comment.
LGTM, I have one follow-up question but if this is blocking something else go ahead and merge.
magik6k
left a comment
There was a problem hiding this comment.
LGTM module the @schomatis comment (not blocking for me)
|
I think I'm going to go ahead and merge but feel free to continue this discussion. |
…5600 feat(Directory): Add EnumLinksAsync method This commit was moved from ipfs/go-unixfs@a3eae7f
Goal
child of ipfs/kubo#5600
Implement an EnumLinksAsync method on Directory interface to support streaming version of
lscommandImplementation
of directory links or error
For Discussion
lsto go-ipfs