ipfs-rust / ipfs-embed

A small embeddable ipfs implementation
348 stars 49 forks source link

Cleanup resources correctly. #65

Closed dvc94ch closed 3 years ago

dvc94ch commented 3 years ago

Closes #63 Closes #64

rklaehn commented 3 years ago

As mentioned on slack, I think it would be nice if we would not have to wait at most gc period / 2 for the thread actually being cleaned up.

A somewhat weird way to achieve this would be to abuse a mpsc channel just to get the delay and the signal on sender drop.

https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver.html#method.recv_timeout