MCPcopy
hub / github.com/bnb-chain/bsc / ClientSubscription

Struct ClientSubscription

rpc/subscription.go:216–237  ·  view source on GitHub ↗

ClientSubscription is a subscription established through the Client's Subscribe or EthSubscribe methods.

Source from the content-addressed store, hash-verified

214// ClientSubscription is a subscription established through the Client's Subscribe or
215// EthSubscribe methods.
216type 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.
240var errUnsubscribed = errors.New("unsubscribed")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected