( current Protocol, protocolPool []Protocol, switchThreshold int32, fetchFunc edgediscovery.PercentageFetcher, ttl time.Duration, log *zerolog.Logger, )
| 136 | } |
| 137 | |
| 138 | func newRemoteProtocolSelector( |
| 139 | current Protocol, |
| 140 | protocolPool []Protocol, |
| 141 | switchThreshold int32, |
| 142 | fetchFunc edgediscovery.PercentageFetcher, |
| 143 | ttl time.Duration, |
| 144 | log *zerolog.Logger, |
| 145 | ) *remoteProtocolSelector { |
| 146 | return &remoteProtocolSelector{ |
| 147 | current: current, |
| 148 | protocolPool: protocolPool, |
| 149 | switchThreshold: switchThreshold, |
| 150 | fetchFunc: fetchFunc, |
| 151 | refreshAfter: time.Now().Add(ttl), |
| 152 | ttl: ttl, |
| 153 | log: log, |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func (s *remoteProtocolSelector) Current() Protocol { |
| 158 | s.lock.Lock() |
no test coverage detected