(resId string)
| 823 | } |
| 824 | |
| 825 | func (w *WshRpc) retrySendTimeout(resId string) { |
| 826 | done := func() bool { |
| 827 | w.Lock.Lock() |
| 828 | defer w.Lock.Unlock() |
| 829 | if w.ServerDone { |
| 830 | return true |
| 831 | } |
| 832 | select { |
| 833 | case w.CtxDoneCh <- resId: |
| 834 | return true |
| 835 | default: |
| 836 | return false |
| 837 | } |
| 838 | } |
| 839 | for { |
| 840 | if done() { |
| 841 | return |
| 842 | } |
| 843 | time.Sleep(100 * time.Millisecond) |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | func (w *WshRpc) sendRespWithBlockMessage(msg RpcMessage) { |
| 848 | respCh, rd := w.getResponseCh(msg.ResId) |