Wait blocks the thread until the node is stopped. If the node is not running at the time of invocation, the method immediately returns.
()
| 446 | // Wait blocks the thread until the node is stopped. If the node is not running |
| 447 | // at the time of invocation, the method immediately returns. |
| 448 | func (n *Node) Wait() { |
| 449 | n.lock.RLock() |
| 450 | if n.server == nil { |
| 451 | n.lock.RUnlock() |
| 452 | return |
| 453 | } |
| 454 | stop := n.quitCh |
| 455 | n.lock.RUnlock() |
| 456 | |
| 457 | <-stop |
| 458 | } |
| 459 | |
| 460 | // Restart terminates a running node and boots up a new one in its place. If the |
| 461 | // node isn't running, an error is returned. |
no outgoing calls