MCPcopy
hub / github.com/redis/go-redis / entraidLikeProvider

Struct entraidLikeProvider

internal_test.go:973–978  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

971// equivalent: the first one called removes the entry, any subsequent call
972// is a safe no-op.
973type entraidLikeProvider struct {
974 mu sync.Mutex
975 listeners []auth.CredentialsListener
976 subscribeN int32
977 unsubCalls int32
978}
979
980func (p *entraidLikeProvider) Subscribe(listener auth.CredentialsListener) (auth.Credentials, auth.UnsubscribeFunc, error) {
981 atomic.AddInt32(&p.subscribeN, 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected