|
22 | 22 | import tractor |
23 | 23 | import click |
24 | 24 |
|
25 | | -from ..service.marketstore import ( |
26 | | - # get_client, |
27 | | - # stream_quotes, |
28 | | - ingest_quote_stream, |
29 | | - # _url, |
30 | | - # _tick_tbk_ids, |
31 | | - # mk_tbk, |
32 | | -) |
| 25 | +# from ..service.marketstore import ( |
| 26 | +# # get_client, |
| 27 | +# # stream_quotes, |
| 28 | +# ingest_quote_stream, |
| 29 | +# # _url, |
| 30 | +# # _tick_tbk_ids, |
| 31 | +# # mk_tbk, |
| 32 | +# ) |
33 | 33 | from ..cli import cli |
34 | 34 | from .. import watchlists as wl |
35 | 35 | from ._util import ( |
@@ -212,44 +212,44 @@ async def main(): |
212 | 212 | trio.run(main) |
213 | 213 |
|
214 | 214 |
|
215 | | -@cli.command() |
216 | | -@click.option('--test-file', '-t', help='Test quote stream file') |
217 | | -@click.option('--tl', is_flag=True, help='Enable tractor logging') |
218 | | -@click.argument('name', nargs=1, required=True) |
219 | | -@click.pass_obj |
220 | | -def ingest(config, name, test_file, tl): |
221 | | - ''' |
222 | | - Ingest real-time broker quotes and ticks to a marketstore instance. |
223 | | -
|
224 | | - ''' |
225 | | - # global opts |
226 | | - loglevel = config['loglevel'] |
227 | | - tractorloglevel = config['tractorloglevel'] |
228 | | - # log = config['log'] |
229 | | - |
230 | | - watchlist_from_file = wl.ensure_watchlists(config['wl_path']) |
231 | | - watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins) |
232 | | - symbols = watchlists[name] |
233 | | - |
234 | | - grouped_syms = {} |
235 | | - for sym in symbols: |
236 | | - symbol, _, provider = sym.rpartition('.') |
237 | | - if provider not in grouped_syms: |
238 | | - grouped_syms[provider] = [] |
239 | | - |
240 | | - grouped_syms[provider].append(symbol) |
241 | | - |
242 | | - async def entry_point(): |
243 | | - async with tractor.open_nursery() as n: |
244 | | - for provider, symbols in grouped_syms.items(): |
245 | | - await n.run_in_actor( |
246 | | - ingest_quote_stream, |
247 | | - name='ingest_marketstore', |
248 | | - symbols=symbols, |
249 | | - brokername=provider, |
250 | | - tries=1, |
251 | | - actorloglevel=loglevel, |
252 | | - loglevel=tractorloglevel |
253 | | - ) |
254 | | - |
255 | | - tractor.run(entry_point) |
| 215 | +# @cli.command() |
| 216 | +# @click.option('--test-file', '-t', help='Test quote stream file') |
| 217 | +# @click.option('--tl', is_flag=True, help='Enable tractor logging') |
| 218 | +# @click.argument('name', nargs=1, required=True) |
| 219 | +# @click.pass_obj |
| 220 | +# def ingest(config, name, test_file, tl): |
| 221 | +# ''' |
| 222 | +# Ingest real-time broker quotes and ticks to a marketstore instance. |
| 223 | + |
| 224 | +# ''' |
| 225 | +# # global opts |
| 226 | +# loglevel = config['loglevel'] |
| 227 | +# tractorloglevel = config['tractorloglevel'] |
| 228 | +# # log = config['log'] |
| 229 | + |
| 230 | +# watchlist_from_file = wl.ensure_watchlists(config['wl_path']) |
| 231 | +# watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins) |
| 232 | +# symbols = watchlists[name] |
| 233 | + |
| 234 | +# grouped_syms = {} |
| 235 | +# for sym in symbols: |
| 236 | +# symbol, _, provider = sym.rpartition('.') |
| 237 | +# if provider not in grouped_syms: |
| 238 | +# grouped_syms[provider] = [] |
| 239 | + |
| 240 | +# grouped_syms[provider].append(symbol) |
| 241 | + |
| 242 | +# async def entry_point(): |
| 243 | +# async with tractor.open_nursery() as n: |
| 244 | +# for provider, symbols in grouped_syms.items(): |
| 245 | +# await n.run_in_actor( |
| 246 | +# ingest_quote_stream, |
| 247 | +# name='ingest_marketstore', |
| 248 | +# symbols=symbols, |
| 249 | +# brokername=provider, |
| 250 | +# tries=1, |
| 251 | +# actorloglevel=loglevel, |
| 252 | +# loglevel=tractorloglevel |
| 253 | +# ) |
| 254 | + |
| 255 | +# tractor.run(entry_point) |
0 commit comments