Make rule-set initialization parallel

This commit is contained in:
世界
2023-11-30 15:28:08 +08:00
parent bbc1d12015
commit cbe2848d8f
7 changed files with 93 additions and 22 deletions

View File

@@ -2,12 +2,14 @@ package adapter
import (
"context"
"net/http"
"net/netip"
"github.com/sagernet/sing-box/common/geoip"
"github.com/sagernet/sing-dns"
"github.com/sagernet/sing-tun"
"github.com/sagernet/sing/common/control"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing/service"
mdns "github.com/miekg/dns"
@@ -83,8 +85,14 @@ type DNSRule interface {
}
type RuleSet interface {
StartContext(ctx context.Context, startContext RuleSetStartContext) error
Close() error
HeadlessRule
Service
}
type RuleSetStartContext interface {
HTTPClient(detour string, dialer N.Dialer) *http.Client
Close()
}
type InterfaceUpdateListener interface {