// EnumLinksAsync returns a channel which will receive Links in the directory
// as they are enumerated, where order is not guaranteed
EnumLinksAsync returns a channel which will receive Links in the directory
as they are enumerated, where order is not guaranteed
// EnumLinksAsync returns a channel which will receive Links in the directory // as they are enumerated where order is not guaranteed
func (ds *Shard) EnumLinksAsync(ctx context.Context) <-chan format.LinkResult {
	linkResults := make(chan format.LinkResult)
	ctx, cancel := context.WithCancel(ctx)
	go func() {
		defer close(linkResults)
		defer cancel()
		err := parallelShardWalk(ctx, ds, ds.dserv, func(formattedLink *ipld.Link) error {
			emitResult(ctx, linkResults, format.LinkResult{Link: formattedLink, Err: nil})
			return nil
		})
		if err != nil {
			emitResult(ctx, linkResults, format.LinkResult{Link: nil, Err: err})
		}
	}()
	return linkResults
}
func ( ds * Shard ) EnumLinksAsync ( ctx context . Context ) <- chan format . LinkResult { linkResults := make ( chan format . LinkResult ) ctx , cancel := context . WithCancel ( ctx ) go func ( ) { defer close ( linkResults ) defer cancel ( ) err := parallelShardWalk ( ctx , ds , ds . dserv , func ( formattedLink * ipld . Link ) error { emitResult ( ctx , linkResults , format . LinkResult { Link : formattedLink , Err : nil } ) return nil } ) if err != nil { emitResult ( ctx , linkResults , format . LinkResult { Link : nil , Err : err } ) } } ( ) return linkResults }
EnumLinksAsync returns a channel which will receive Links in the directory
as they are enumerated, where order is not guaranteed
EnumLinksAsync returns a channel which will receive Links in the directory as they are enumerated where order is not guaranteed