Open
Description
Starting and stopping services on the host has long been a pain point. By using fx's lifecycle hooks we could potentially dramatically simplify our code base.
This is the Close
logic in the BasicHost
:
go-libp2p/p2p/host/basic/basic_host.go
Lines 972 to 1011 in c48e78f
There also exist wrapped hosts only for hooking into the Close
method, for example here:
go-libp2p/p2p/host/autorelay/host.go
Lines 7 to 15 in c48e78f