You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
527 B

package config
import (
"context"
basichost "github.com/libp2p/go-libp2p/p2p/host/basic"
routed "github.com/libp2p/go-libp2p/p2p/host/routed"
"go.uber.org/fx"
)
type closableBasicHost struct {
*fx.App
*basichost.BasicHost
}
func (h *closableBasicHost) Close() error {
_ = h.App.Stop(context.Background())
return h.BasicHost.Close()
}
type closableRoutedHost struct {
*fx.App
*routed.RoutedHost
}
func (h *closableRoutedHost) Close() error {
_ = h.App.Stop(context.Background())
return h.RoutedHost.Close()
}