(timeout time.Duration)
| 284 | } |
| 285 | |
| 286 | func serviceThatStopsOnItsOwnAfterTimeout(timeout time.Duration) Service { |
| 287 | return NewBasicService(nil, func(serviceContext context.Context) error { |
| 288 | select { |
| 289 | case <-serviceContext.Done(): |
| 290 | return nil |
| 291 | case <-time.After(timeout): |
| 292 | return nil |
| 293 | } |
| 294 | }, nil) |
| 295 | } |
| 296 | |
| 297 | func serviceThatDoesntDoAnything() Service { |
| 298 | // but respects StopAsync and stops. |
no test coverage detected