MCPcopy Index your code
hub / github.com/cortexproject/cortex / ServiceContext

Method ServiceContext

pkg/util/services/basic_service.go:274–281  ·  view source on GitHub ↗

ServiceContext returns context that this service uses internally for controlling its lifecycle. It is the same context that is passed to Starting and Running functions, and is based on context passed to the service via StartAsync. Before service enters Starting state, there is no context. This cont

()

Source from the content-addressed store, hash-verified

272//
273// This is not part of Service interface, and clients of the Service should not use it.
274func (b *BasicService) ServiceContext() context.Context {
275 s := b.State()
276 if s == New {
277 return nil
278 }
279 // no need for locking, as we have checked the state.
280 return b.serviceContext
281}
282
283// AwaitRunning is part of Service interface.
284func (b *BasicService) AwaitRunning(ctx context.Context) error {

Callers 6

sendToLifecyclerLoopMethod · 0.80
runMethod · 0.80
AddressAddedMethod · 0.80
flushHandlerMethod · 0.80
LivenessCheckMethod · 0.80
SendMethod · 0.80

Calls 1

StateMethod · 0.95

Tested by 1

SendMethod · 0.64