Open
Description
I was looking at the code and something caught my attention. I see that instantiating a peer would spin up a goroutine that would wait on the context.Done channel and then close some of the underlying dependencies.
https://github.com/hsanjuan/ipfs-lite/blob/master/ipfs.go#L128
I might be wrong, but it seems like there's no way to wait until this shutdown process is actually finished. The autoclose
goroutine is not signaling anywhere when it's done.
Wouldn't it be more correct to provide explicit Close
method so that users of ipfs-lite could chose to wait until the peer is actually closed? Another approach could be providing an explicit Start
method that would block and could accept a context for being canceled.
Metadata
Assignees
Labels
No labels
Activity