(ctx context.Context, routeId string)
| 397 | } |
| 398 | |
| 399 | func (router *WshRouter) WaitForRegister(ctx context.Context, routeId string) error { |
| 400 | for { |
| 401 | if router.getLinkForRoute(routeId) != nil { |
| 402 | return nil |
| 403 | } |
| 404 | select { |
| 405 | case <-ctx.Done(): |
| 406 | return ctx.Err() |
| 407 | case <-time.After(30 * time.Millisecond): |
| 408 | continue |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | // this will never block, can be called while holding router.Lock |
| 414 | func (router *WshRouter) queueUpstreamMessage(msgBytes []byte, debugStr string) { |
no test coverage detected