Commit Graph
22 Commits
Author SHA1 Message Date
John Colvin 74332f9944 fix: Pass IMarketDataClient to PrimitiveManager to enable md streams
In DataStreamQueryAnalyzer and Spark Api Server
2026-02-23 11:24:33 -05:00
arham 210768e391 fix: handle badrequests in websocket api 2026-02-18 05:40:27 +00:00
John Colvin 856cd552eb refactor: Add Api Server service modules for Dependency Injection
* Part of a broader paradigm shift towards Dependency Injection and
  Factory Pattern.
* Adds "api-server" service to docker compose
* Replaces MarketDataClient w/ IMarketDataClient in a few streams
* Replaces ViewStreamDatabase w/ IWorkScheduler in a few streams
2026-01-04 21:08:12 +00:00
John Colvin 6986cb5e8e fix: Ensure spark config init and login are only performed once
As a static function that could be called from anywhere in the code
(directly or indirectly), 'Configuration.Initialize' was vulnerable to
race bugs. The "Configuration.get<T>()" method, whose calls are
ubiquitous in our code, would initialize config if it hadn't been done
so already. Without a reference to the configServer param, this param
would effectively be ignored/overridden with null.

It's important that login only be performed once, for obvious reasons
(our exes that connect to sparkd are generally designed to process data
for a single user). Furthermore, not every routine that requires a
successful login has a reference to the credentials needed to do it. To
address this, we now pass the ISparkdLoginService singleton to these
routines so they can wait until the singular login task has completed
before they begin.
2026-01-04 21:08:12 +00:00
John Colvin 3a6141f3ae refactor: Change Configuration.initialize to be async
Tweak SparkCoreServices to synchronize Configuration.init globally
2025-12-30 11:42:20 -05:00
arham aabf1490eb Fix: Trycatch on base program.cs to prevent crash 2025-12-03 12:21:03 +00:00
John Colvin 2014931653 feat: Add live bbo stream 2025-11-19 10:33:31 -05:00
arham 77e542efa9 Fix: websocket code 2025-09-02 17:17:43 +00:00
John Colvin 691343d9b6 feat: Add datastreams to spark api server 2024-11-28 06:14:00 +00:00
John Colvin 8ae940bcbc fix: Change "init" call to "initAsync" in spark_api_server main
WebsocketDataSync.init was refactored to initAsync
2024-04-01 10:09:23 -04:00
John Colvin 292ed2dc0e refactor: Convert WebsocketServerParams to proto 2023-10-02 20:45:32 -04:00
Taha Afzal cce8973e87 temp changes to make binance work 2023-04-24 23:19:15 +00:00
John Colvin 7bb0951169 feat: Add dump-books/securities cmds to api server cli 2023-03-20 13:26:43 -04:00
John Colvin fa0e6f7c10 fix: Get rid of 'Press any key to cancel' prompt
Console.Read throws an exception when running on linux. Furthermore, the
process can still be killed w/ ctrl+c so this doesn't remove any
functionality.
2023-03-20 13:26:43 -04:00
John Colvin ea5156122c refactor: Init ServiceContext & login outside of data sync
The login process is asynchronous, so it doesn't really fit in the
(synchronous) 'WebsocketDataSync.init' fn. This also reduces some state
in WebsocketDataSync, which is always a good thing, as it makes the
ServiceContext member readonly, and allows it to assume the user is
already logged in.
2023-03-20 13:26:41 -04:00
John Colvin 762baca586 improvement: Add Errors enum mapped to exit code 2023-02-01 15:16:08 -05:00
arhamGIT 01eeadaf42 added changed suggested by john 2023-02-01 03:29:22 -05:00
arhamGIT 4e42125398 changed Programs.cs to use task.wait 2023-01-31 23:58:11 -05:00
arhamGIT 4c91538f22 base websockets working 2023-01-04 04:34:44 -05:00
Taha Afzal 45668baaf8 Adding code to Main 2022-12-20 12:17:51 -05:00
Taha Afzal 305cc0e01c Adding simple concrete classes 2022-12-20 12:00:46 -05:00
John Colvin 306c18065a chore: Add csproj bones for websocket api 2022-12-19 14:25:37 -05:00