ClientSubscription is a subscription established through the Client's Subscribe or EthSubscribe methods.
| 214 | // ClientSubscription is a subscription established through the Client's Subscribe or |
| 215 | // EthSubscribe methods. |
| 216 | type ClientSubscription struct { |
| 217 | client *Client |
| 218 | etype reflect.Type |
| 219 | channel reflect.Value |
| 220 | namespace string |
| 221 | subid string |
| 222 | |
| 223 | // The in channel receives notification values from client dispatcher. |
| 224 | in chan json.RawMessage |
| 225 | |
| 226 | // The error channel receives the error from the forwarding loop. |
| 227 | // It is closed by Unsubscribe. |
| 228 | err chan error |
| 229 | errOnce sync.Once |
| 230 | |
| 231 | // Closing of the subscription is requested by sending on 'quit'. This is handled by |
| 232 | // the forwarding loop, which closes 'forwardDone' when it has stopped sending to |
| 233 | // sub.channel. Finally, 'unsubDone' is closed after unsubscribing on the server side. |
| 234 | quit chan error |
| 235 | forwardDone chan struct{} |
| 236 | unsubDone chan struct{} |
| 237 | } |
| 238 | |
| 239 | // This is the sentinel value sent on sub.quit when Unsubscribe is called. |
| 240 | var errUnsubscribed = errors.New("unsubscribed") |
nothing calls this directly
no outgoing calls
no test coverage detected