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

Function ExampleService

services/example_test.go:51–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func ExampleService() {
52 es := newExampleServ()
53 es.Send("first") // ignored, as service is not running yet
54
55 _ = es.StartAsync(context.Background())
56 _ = es.AwaitRunning(context.Background())
57
58 es.Send("second")
59
60 es.StopAsync()
61 _ = es.AwaitTerminated(context.Background())
62
63 es.Send("third") // ignored, service is now stopped
64
65 fmt.Println(es.log)
66 // Output: [second]
67}

Callers

nothing calls this directly

Calls 6

newExampleServFunction · 0.85
SendMethod · 0.65
StartAsyncMethod · 0.65
AwaitRunningMethod · 0.65
StopAsyncMethod · 0.65
AwaitTerminatedMethod · 0.65

Tested by

no test coverage detected