wait submits an async task and blocks until it completes. This can be used during tests to ensure that async "sets" have completed before attempting to read them.
()
| 625 | // wait submits an async task and blocks until it completes. This can be used during |
| 626 | // tests to ensure that async "sets" have completed before attempting to read them. |
| 627 | func (c *MemcachedClient) wait() error { |
| 628 | var wg sync.WaitGroup |
| 629 | |
| 630 | wg.Add(1) |
| 631 | err := c.queue.submit(func() { |
| 632 | wg.Done() |
| 633 | }) |
| 634 | if err != nil { |
| 635 | return err |
| 636 | } |
| 637 | |
| 638 | wg.Wait() |
| 639 | return nil |
| 640 | } |
| 641 | |
| 642 | func (c *MemcachedClient) trackError(op string, err error, msg ...interface{}) { |
| 643 | severity := level.DebugValue() |