An explicit name is prolly better
parent
714c203c3e
commit
75d22c6058
|
@ -4,7 +4,7 @@ Async utils no one seems to have built into a core lib (yet).
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
|
||||||
def alifo_cache(maxsize=128):
|
def async_lifo_cache(maxsize=128):
|
||||||
"""Async ``cache`` with a LIFO policy.
|
"""Async ``cache`` with a LIFO policy.
|
||||||
|
|
||||||
Implemented my own since no one else seems to have
|
Implemented my own since no one else seems to have
|
||||||
|
|
|
@ -14,7 +14,7 @@ from ..calc import humanize, percent_change
|
||||||
from . import config
|
from . import config
|
||||||
from ._util import resproc, BrokerError
|
from ._util import resproc, BrokerError
|
||||||
from ..log import get_logger, colorize_json
|
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
|
# TODO: move to urllib3/requests once supported
|
||||||
import asks
|
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.
|
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]):
|
async def get_symbol_id_seq(symbols: Tuple[str]):
|
||||||
"""For each tuple ``(symbol_1, symbol_2, ... , symbol_n)``
|
"""For each tuple ``(symbol_1, symbol_2, ... , symbol_n)``
|
||||||
return a symbol id sequence string ``'id_1,id_2, ... , id_n'``.
|
return a symbol id sequence string ``'id_1,id_2, ... , id_n'``.
|
||||||
|
|
Loading…
Reference in New Issue