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

Function NewBasicService

services/basic_service.go:84–93  ·  view source on GitHub ↗

NewBasicService returns service built from three functions (using BasicService).

(start StartingFn, run RunningFn, stop StoppingFn)

Source from the content-addressed store, hash-verified

82
83// NewBasicService returns service built from three functions (using BasicService).
84func NewBasicService(start StartingFn, run RunningFn, stop StoppingFn) *BasicService {
85 return &BasicService{
86 startFn: start,
87 runningFn: run,
88 stoppingFn: stop,
89 state: New,
90 runningWaitersCh: make(chan struct{}),
91 terminatedWaitersCh: make(chan struct{}),
92 }
93}
94
95// WithName sets service name, if service is still in New state, and returns service to allow
96// usage like NewBasicService(...).WithName("service name").

Callers 15

NewLifecyclerFunction · 0.92
NewBasicLifecyclerFunction · 0.92
NewKVInitServiceFunction · 0.92
NewKVFunction · 0.92
NewModuleServiceFunction · 0.92
NewFunction · 0.92

Calls

no outgoing calls