entraidLikeProvider mimics the exact semantics of github.com/redis/go-redis-entraid's StreamingCredentialsProvider relevant to issue #3772: it deduplicates subscriptions by listener pointer identity, and every call to Subscribe returns a FRESH UnsubscribeFunc closure that removes the listener by poi
| 971 | // equivalent: the first one called removes the entry, any subsequent call |
| 972 | // is a safe no-op. |
| 973 | type entraidLikeProvider struct { |
| 974 | mu sync.Mutex |
| 975 | listeners []auth.CredentialsListener |
| 976 | subscribeN int32 |
| 977 | unsubCalls int32 |
| 978 | } |
| 979 | |
| 980 | func (p *entraidLikeProvider) Subscribe(listener auth.CredentialsListener) (auth.Credentials, auth.UnsubscribeFunc, error) { |
| 981 | atomic.AddInt32(&p.subscribeN, 1) |
nothing calls this directly
no outgoing calls
no test coverage detected