use fx lifecycle hooks to start and stop services #1876
Labels
effort/days
Estimated to take multiple days, but less than a week
exp/expert
Having worked on the specific codebase is important
kind/enhancement
A net-new feature or improvement to an existing feature
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 theBasicHost
: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
The text was updated successfully, but these errors were encountered: