Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

feat: Add DialCache for key-based connection caching #391

Merged
merged 7 commits into from
Jul 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comment
  • Loading branch information
kylecarbs committed Jul 21, 2021
commit 1199814fb6a49f63b88eba3787c3685399dce5fe
5 changes: 3 additions & 2 deletions wsnet/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ func DialCache(ttl time.Duration) *DialerCache {
type DialerCache struct {
ttl time.Duration
flightGroup *singleflight.Group
closed chan struct{}
mut sync.RWMutex

closed chan struct{}
mut sync.RWMutex
// Key is the "key" of a dialer.
dialers map[string]*Dialer
atime map[string]time.Time
}
Expand Down