MCPcopy
hub / github.com/grpc/grpc-go / Distributor

Struct Distributor

credentials/tls/certprovider/distributor.go:39–51  ·  view source on GitHub ↗

Distributor makes it easy for provider implementations to furnish new key materials by handling synchronization between the producer and consumers of the key material. Provider implementations which choose to use a Distributor should do the following: - create a new Distributor using the NewDistrib

Source from the content-addressed store, hash-verified

37// - delegate to the distributor when handing calls to KeyMaterial().
38// - invoke the Stop() method when they are done using the distributor.
39type Distributor struct {
40 // mu protects the underlying key material.
41 mu sync.Mutex
42 km *KeyMaterial
43 pErr error
44
45 // ready channel to unblock KeyMaterial() invocations blocked on
46 // availability of key material.
47 ready *grpcsync.Event
48 // done channel to notify provider implementations and unblock any
49 // KeyMaterial() calls, once the Distributor is closed.
50 closed *grpcsync.Event
51}
52
53// NewDistributor returns a new Distributor.
54func NewDistributor() *Distributor {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected