()
| 49 | } |
| 50 | |
| 51 | func 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 | } |
nothing calls this directly
no test coverage detected