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

Function NewIdleService

services/services.go:11–18  ·  view source on GitHub ↗

NewIdleService initializes basic service as an "idle" service -- it doesn't do anything in its Running state, but still supports all state transitions.

(up StartingFn, down StoppingFn)

Source from the content-addressed store, hash-verified

9// NewIdleService initializes basic service as an "idle" service -- it doesn't do anything in its Running state,
10// but still supports all state transitions.
11func NewIdleService(up StartingFn, down StoppingFn) *BasicService {
12 run := func(ctx context.Context) error {
13 <-ctx.Done()
14 return nil
15 }
16
17 return NewBasicService(up, run, down)
18}
19
20// OneIteration is one iteration of the timer service. Called repeatedly until service is stopped, or this function returns error
21// in which case, service will fail.

Calls 2

NewBasicServiceFunction · 0.85
DoneMethod · 0.65