Monitor executes f in a new goroutine attended by a [Monitor]. The caller is responsible for waiting for the goroutine to complete, by calling either [Monitor.Close] or [Monitor.Wait].
(f func(*Client))
| 48 | // is responsible for waiting for the goroutine to complete, by calling either |
| 49 | // [Monitor.Close] or [Monitor.Wait]. |
| 50 | func (c *Client) Monitor(f func(*Client)) Monitor { |
| 51 | done := make(chan struct{}) |
| 52 | go func() { defer close(done); f(c) }() |
| 53 | return Monitor{cli: c, done: done} |
| 54 | } |
no outgoing calls