Commit Graph
119 Commits
Author SHA1 Message Date
Mohammad Arham 40e44db597 Fix: Added GCHandle in attempt to fix ui crash 2025-01-22 02:15:55 -05:00
John Colvin 4a2735839e Change line endings to crlf in a few cs files 2024-06-06 09:21:00 -05:00
John Colvin 9a7b3cb77c refactor: Reduce code (simplify) in BTS.init
Remove the 'args' parameter, since the cmd line can be obtained from
Environment.GetCommandLine anyways
2024-06-06 09:15:16 -05:00
Taha af9dd0c1fe PubSub Streams to get list of tags etc 2023-10-02 19:38:38 -04:00
John Colvin 6d2cd54deb fix: Init config w/ (optional) server arg in cli 2023-04-16 00:29:31 -04:00
John Colvin 593be8d069 diag: Log error on login fail 2023-03-20 13:26:43 -04:00
John Colvin 7bb0951169 feat: Add dump-books/securities cmds to api server cli 2023-03-20 13:26:43 -04:00
John Colvin 97b974a31f refactor: Clean up ServiceContext a bit 2023-03-20 13:23:49 -04:00
John Colvin ef98682620 refactor: Add IServiceProvider interface to Spark.Api
Designed to resemble Microsoft's well-known interface,
System.IServiceProvider
2023-03-20 13:23:49 -04:00
John Colvin fd9892c6b6 fix: Prevent raw_pb_callback premature garbage collection
Bugs (fixed):
   * Startup crash w/ error message: "A callback was made on a garbage
     collected delegate of type ApiNativeMethods.raw_pb_callback"

   Cause: The callback is only referenced in unmanaged c++. Without references
   in managed code, the Garbage Collector deems the delegate eligible for
   collection before the callback has finished execution.

   Note: The original solution forced a reference in managed code by storing it
   in a class-member 'keepalive' dictionary, whose life isn't bound to the
   [synchronous] scope of the 'send' method. The callback would then remove
   itself from the dictionary in its last line of code. While this reduced the
   chance of such an error occurring, occassional crashes persisted
   (particularly in low-bandwidth environments). I suspect the frequency at
   which garbage-collector threads run is inversely related to the frequency
   at which data arrives from the server, as the latter triggers execution of
   higher-priority threads.

   Steps to repro:
      1. Insert a Thread.Sleep statement (1000 ms should be sufficient) after
         the call that removes the last reference to the delegate (i.e., make
         the thread sleep for a significant amount of time in the callback
         AFTER it becomes eligible for garbage collection).

      2. Build, run, and observe crash on startup.

   Solution: Wrap the callback in another class, and store the wrapper
   in the dictionary rather than the callback itself. The reason why this
   works isn't totally clear, however its effectiveness has been verified
   with the repro (described above).
2022-12-23 11:25:07 -05:00
John Colvin 9287149c26 refactor: Clean up 'bts.api.core.Result<T>'
Impl ToString while we're at it
2022-09-02 10:14:02 -05:00
John Colvin 306b56a999 fix (hopeful): Make sure callback disposed after subscription
Hopefully this fixes the 'Garbage Collected callback' crash on login
2022-09-02 09:45:02 -05:00
John Colvin 1d796856ca refactor: Make spark_api depend on spark_core (not other way around) 2022-08-22 00:03:11 -04:00
John Colvin 99371a2ead feat: Add Open Orders window 2022-08-16 17:25:03 -04:00
John Colvin 941956c1b5 fix: Actually supress false changes in 'to_table_checked' ext 2022-08-07 13:51:54 -04:00
John Colvin 76ec2c0fa2 fix: Pass key_fn to TableUpdate Operate ext
Bugs (fixed):
  * PNL window crashes immediately when opened

    Cause: The 'Operate' ext fn aggregates an IObservable of TableUpdates w/
    another IObservable of any T.  If the latter fires before the former, an
    'empty' TableUpdate is passed to the aggregate fn.  When this happens, a
    null ref ex is thrown in the 'empty' TableUpdate's ctr because the key
    param is null.
2022-08-01 11:14:28 -04:00
John Colvin 7634ecf730 refactor: Break up massive file Update.cs
Into one file per class
2022-05-25 14:19:04 -04:00
John Colvin 309d1fa287 refactor: Remove LegacyTableUpdate class 2022-05-25 14:19:04 -04:00
John Colvin 9231a91fb4 Fix typo in Update.merge fn
Bugs (fixed):
   * When merging updates, a new ChangeDict is always instantiated
   (sometimes unnecessarily).  This was causing a performance hit, but
   not actual bad/incorrect behavior, so it went unnoticed for years
2022-05-25 14:19:04 -04:00
John Colvin 74fcacd800 Clear 'raw' (unfiltered) table changes on filter-updates
Otherwise, it would repeat the changes from the last data-update, and
break the incremental sequence
2022-05-25 14:19:03 -04:00
John Colvin 3bff50b764 diag: Add TableUpdate.description ext
For diagnostic logging/tracking down bugs
2022-05-25 14:19:03 -04:00
John Colvin c793ec78a2 Don't send empty updates in TableUpdate Filter ext 2022-05-25 14:19:02 -04:00
John Colvin 1e5c56f3a7 refactor: Make key param optional in TableUpdate Filter ext 2022-05-25 14:06:49 -04:00
John Colvin 4f6a0061fe refactor: Clean up ObservableDemuxer
* Move to spark_core
* Split classes into sep files
* Use new lang feats
* Run formatter
2022-04-19 11:42:40 -04:00
John Colvin 8b5d79847f Add 'Select' ext fns for Update/TableUpdate 2022-04-19 11:42:39 -04:00
John Colvin 6874c8f6b9 style: Use dos line endings in QuickBusClientChannel.cs 2021-12-29 13:18:49 -05:00
John Colvin f94c5bc542 SP-273 Fills are unselected when order tree changes 2019-12-04 13:24:30 -06:00
John Colvin 8b68beae96 Merge remote-tracking branch 'origin/master' into bts-admin-permissions 2019-10-02 10:52:45 -05:00
John Colvin 055f0015e7 Update.naggle pr edit: 'TryPop' is an innappropriate name (just use 'Remove') 2019-09-24 17:28:06 -05:00
John Colvin a3730eb203 Update.naggle merge maintains changes (could get into state where changes became adds/removes) 2019-09-24 13:32:53 -05:00
John Colvin 80850146c1 TableUpdate.AggregateLatest shouldn't share seed across subscriptions 2019-09-23 00:08:12 -05:00
John Colvin ff9c9e2d64 Merge branch 'master' into pnl_draft 2019-09-04 18:41:24 -05:00
Eric Harding d544511993 Additional managed init cleanup 2019-08-28 15:47:36 -04:00
John Colvin 0864925031 TableCheckedAutoCorrect diagnostic method 2019-08-19 14:56:25 -05:00
John Colvin 3569500111 TableUpdate 'Operate' extension 2019-08-19 13:14:58 -05:00
John Colvin 05cfcb5648 TableUpdate 'BufferTable' extension 2019-08-19 13:14:58 -05:00
John Colvin e425064730 TableUpdate 'GroupTable' extension 2019-08-19 13:14:58 -05:00
John Colvin f35a674b9f impl TableUpdate FullJoin 2019-08-19 13:14:58 -05:00
John Colvin 03a4691bc0 added some TableUpdate diagnostic utils 2019-08-19 13:14:58 -05:00
Eric Harding c5cf90017e Fix failing test 'test_select_tableupdate' broken by 6430f6e 2019-08-05 10:08:20 -04:00
John Colvin 6430f6e2df fix TableUpdate 'SelectKeyValue' extensions (subscriptions cannot share the same cache) 2019-07-25 17:46:13 -05:00
Kevin Darby c09ef31061 Added a warning message and facility to allow concurrent logins in a keycode 2019-06-18 15:07:08 -04:00
Michael Harding 171396ca57 Merged in system_tests (pull request #228)
System Tests
2019-05-14 13:51:33 +00:00
John Colvin 648f808583 SPARK-2409 / SPARK-2422 fix duplicate algo items in (Root)OrderType col filters 2019-05-08 20:53:54 -05:00
John Colvin 39d59dbbb0 IObservable<IReadOnlyDictionary>.Table() extension applies value-changes to state 2019-05-08 18:43:03 -05:00
John Colvin ca73b20fe5 made 'MergeTable' extension method for TableUpdate 2019-05-04 13:16:45 -05:00
John Colvin 6fba76b399 SPARK-2365 Crash when entering limit orders at various levels quickly (log attached) 2019-05-01 23:51:29 -05:00
Michael Harding 3e822bcca1 Merge branch 'master' into spreader_test 2019-05-01 10:58:30 -04:00
Eric Harding 31e767208e merge master 2019-04-30 17:10:38 -04:00
John Colvin e6f4c9c1ad TableUpdate.FilterWithRaw - remove temp diagnostic code added by accident 2019-04-23 22:59:16 -05:00