Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimedFetch ¶
func TimedFetch(baseURL string, params url.Values, options TimedFetchOptions, callback func(*gjson.Result, error))
timedFetch makes requests to API endpoint that updates every expected `interval`, resistant to clock drift by 1 `margin` ahead and n `delay` behind. Algo: 1m 1m 1m 1m. If lastVal != val, 4m. 15s 15s 15s 15s. If lastVal != val, 4m.59s. 1s 1s 1s 1s. If lastVal != val, 4m.59.5s
Types ¶
type BinanceConnector ¶
func (*BinanceConnector) Start ¶
func (c *BinanceConnector) Start()
type TimedFetchOptions ¶
type TimedFetchOptions struct { Interval, Margin, Delay, Decay int // decay factor for each round. Affects how fast it syncs to remote emission at the cost of more requests. }
Interval, Margin, Delay are in ms `decay` is the muliple at which the delay decreases.
Click to show internal directories.
Click to hide internal directories.