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

Function oneTimeAllowingThrottler

balancer/rls/helpers_test.go:106–111  ·  view source on GitHub ↗

oneTimeAllowingThrottler returns a fake throttler which does not throttle requests until the client RPC succeeds, but throttles everything that comes after. This is useful for tests which need to set up a valid cache entry before testing other cases.

(firstRPCDone *grpcsync.Event)

Source from the content-addressed store, hash-verified

104// after. This is useful for tests which need to set up a valid cache entry
105// before testing other cases.
106func oneTimeAllowingThrottler(firstRPCDone *grpcsync.Event) *fakeThrottler {
107 return &fakeThrottler{
108 throttleFunc: firstRPCDone.HasFired,
109 throttleCh: make(chan struct{}, 1),
110 }
111}
112
113func overrideAdaptiveThrottler(t *testing.T, f *fakeThrottler) {
114 origAdaptiveThrottler := newAdaptiveThrottler

Calls

no outgoing calls

Tested by

no test coverage detected