MCPcopy Create free account
hub / github.com/ethstorage/es-node / PollingClient

Struct PollingClient

ethstorage/eth/polling_client.go:32–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30var ErrSubscriberClosed = errors.New("subscriber closed")
31
32type PollingClient struct {
33 *ethclient.Client
34 isHTTP bool
35 lg log.Logger
36 pollRate time.Duration
37 ctx context.Context
38 cancel context.CancelFunc
39 currHead *types.Header
40 esContract common.Address
41 subID int
42 NetworkID *big.Int
43 queryHeader func() (*types.Header, error)
44
45 // pollReqCh is used to request new polls of the upstream
46 // RPC client.
47 pollReqCh chan struct{}
48
49 mtx sync.RWMutex
50
51 subs map[int]chan *types.Header
52
53 closedCh chan struct{}
54}
55
56// Dial connects a client to the given URL.
57func Dial(rawurl string, esContract common.Address, pollRate uint64, lg log.Logger) (*PollingClient, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected