New features and bug fixes

- Modifications made to the request package. Planned improvements will be
sending requests on intervals, rate limiter back off support, dynamic tuning
and requests packaged into a request job group.
- Can modify each exchanges individual HTTP client (e.g timeout and
transport settings).
- Bot now uses an exchange config HTTP timeout value.
- Bot now uses a global HTTP timeout (configurable).
- Batched ticker request support for exchanges.
- Ticker and Orderbook fetching now are spanned accross multiple
go routines and regulated by a sync wait group.
- Fixes hack used to load exchanges, now uses a sync wait group.
- Ticker and Orderbook storage and fetching now uses mutex locks.
- New pair function for finding different pairs between two supplied
 pair arrays. This is used for currency pair updates for exchange which
support dynamic updating.
- Shows removal/additions of dynamic updates currencies.
This commit is contained in:
Adrian Gallagher
2018-05-04 13:20:19 +10:00
parent 8eef67339d
commit ac41a7cfad
73 changed files with 1327 additions and 742 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"log"
"net/http"
"strconv"
"time"
@@ -39,15 +38,14 @@ const (
alphapointOrderFee = "GetOrderFee"
// alphapoint rate times
alphapointAuthRate = 1200
alphapointUnauthRate = 1200
alphapointAuthRate = 500
alphapointUnauthRate = 500
)
// Alphapoint is the overarching type across the alphapoint package
type Alphapoint struct {
exchange.Base
WebsocketConn *websocket.Conn
*request.Handler
}
// SetDefaults sets current default settings
@@ -56,8 +54,8 @@ func (a *Alphapoint) SetDefaults() {
a.WebsocketURL = alphapointDefaultWebsocketURL
a.AssetTypes = []string{ticker.Spot}
a.SupportsAutoPairUpdating = false
a.Handler = new(request.Handler)
a.SetRequestHandler(a.Name, alphapointAuthRate, alphapointUnauthRate, new(http.Client))
a.SupportsRESTTickerBatching = false
a.Requester = request.New(a.Name, request.NewRateLimit(time.Minute*10, alphapointAuthRate), request.NewRateLimit(time.Minute*10, alphapointUnauthRate), common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
}
// GetTicker returns current ticker information from Alphapoint for a selected