MCPcopy
hub / github.com/grafana/dskit / sendToLifecyclerLoop

Method sendToLifecyclerLoop

ring/lifecycler.go:337–349  ·  view source on GitHub ↗
(fn func())

Source from the content-addressed store, hash-verified

335}
336
337func (i *Lifecycler) sendToLifecyclerLoop(fn func()) error {
338 sc := i.ServiceContext()
339 if sc == nil {
340 return errors.New("lifecycler not running")
341 }
342
343 select {
344 case <-sc.Done():
345 return errors.New("lifecycler not running")
346 case i.actorChan <- fn:
347 return nil
348 }
349}
350
351// ChangeState of the ingester, for use off of the loop() goroutine.
352func (i *Lifecycler) ChangeState(ctx context.Context, state InstanceState) error {

Callers 3

ChangeStateMethod · 0.95
ChangeReadOnlyStateMethod · 0.95
ClaimTokensForMethod · 0.95

Calls 2

ServiceContextMethod · 0.80
DoneMethod · 0.65

Tested by

no test coverage detected