From 75d22c60580ec4f08bd74e6851722d7607a5cba9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 25 Nov 2018 19:23:07 -0500 Subject: [PATCH] An explicit name is prolly better --- piker/_async_utils.py | 2 +- piker/brokers/questrade.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/piker/_async_utils.py b/piker/_async_utils.py index ca3f5b4d..7069d597 100644 --- a/piker/_async_utils.py +++ b/piker/_async_utils.py @@ -4,7 +4,7 @@ Async utils no one seems to have built into a core lib (yet). from collections import OrderedDict -def alifo_cache(maxsize=128): +def async_lifo_cache(maxsize=128): """Async ``cache`` with a LIFO policy. Implemented my own since no one else seems to have diff --git a/piker/brokers/questrade.py b/piker/brokers/questrade.py index 464b293a..4192c2de 100644 --- a/piker/brokers/questrade.py +++ b/piker/brokers/questrade.py @@ -14,7 +14,7 @@ from ..calc import humanize, percent_change from . import config from ._util import resproc, BrokerError from ..log import get_logger, colorize_json -from .._async_utils import alifo_cache +from .._async_utils import async_lifo_cache # TODO: move to urllib3/requests once supported import asks @@ -400,7 +400,7 @@ async def quoter(client: Client, tickers: List[str]): Most of the closure variables here are to deal with that. """ - @alifo_cache(maxsize=128) + @async_lifo_cache(maxsize=128) async def get_symbol_id_seq(symbols: Tuple[str]): """For each tuple ``(symbol_1, symbol_2, ... , symbol_n)`` return a symbol id sequence string ``'id_1,id_2, ... , id_n'``.