From 837e30ff687bf1aa04439b2769269f5f076e7b0b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 18 Feb 2020 16:13:20 -0500 Subject: [PATCH] use >1 asks session connections Gets us better throughput when polling multiple endpoints (eg. option and stock quotes simultaneously) since slower round trip request won't block faster ones when using multiple connections. --- piker/brokers/questrade.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piker/brokers/questrade.py b/piker/brokers/questrade.py index 1c82f12f..67e3988f 100644 --- a/piker/brokers/questrade.py +++ b/piker/brokers/questrade.py @@ -212,7 +212,10 @@ class Client: self, config: dict, ): - self._sess = asks.Session() + # use 2 connections per streaming endpoint (stocks, opts) + # TODO: when we have more then one account key then this should scale + # linearly with that. + self._sess = asks.Session(connections=4) self.api = _API(self) self._conf = config self._is_practice = _use_practice_account or (