MCPcopy Index your code
hub / github.com/riverqueue/river / StartStopFunc

Function StartStopFunc

rivershared/startstop/start_stop.go:270–274  ·  view source on GitHub ↗

StartStopFunc produces a `startstop.Service` from a function. It's useful for very small services that don't necessarily need a whole struct defined for them.

(startFunc func(ctx context.Context, shouldStart bool, started, stopped func()) error)

Source from the content-addressed store, hash-verified

268// very small services that don't necessarily need a whole struct defined for
269// them.
270func StartStopFunc(startFunc func(ctx context.Context, shouldStart bool, started, stopped func()) error) *startStopFunc {
271 return &startStopFunc{
272 startFunc: startFunc,
273 }
274}
275
276func (s *startStopFunc) Start(ctx context.Context) error {
277 return s.startFunc(s.StartInit(ctx))

Callers 5

newPilotWithPluginFunction · 0.92
NewClientFunction · 0.92
StartMethod · 0.92
TestBaseStartStopFuncFunction · 0.85
TestErrStopFunction · 0.85

Calls

no outgoing calls

Tested by 3

newPilotWithPluginFunction · 0.74
TestBaseStartStopFuncFunction · 0.68
TestErrStopFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…