Commit Graph

4356 Commits (44b8c705214c4e71ec635ae9440ba0f807fbfedd)

Author SHA1 Message Date
goodboy b00b872414
Merge pull request #36 from pikers/daemonize
Daemonize broker quote engine
2018-04-23 00:47:51 -04:00
Tyler Goodlet 482f9531ca Try to connect to daemon once on startup; don't poll 2018-04-22 13:27:41 -04:00
Tyler Goodlet a2c4f0c80b Don't recurse in Client.aiter_recv() 2018-04-22 12:48:35 -04:00
Tyler Goodlet 6a6f773477 Adjust some log levels 2018-04-20 13:18:35 -04:00
Tyler Goodlet 063dfad5b4 Make daemon registry cross-task 2018-04-20 13:18:35 -04:00
Tyler Goodlet 4f387ea2be Fix subscriptions and connection handling
Oh boy where to start.

- Handle broken streams in the `StreamQueue` gracefully; terminate the
  async generator.
- When a stream queue connection is unwritable discard its subscriptions
  inside the quoter task
- If all subscriptions are discarded for a broker then tear down its
  quoter task
- Use listener parent nursery for spawning quoter tasks
- Make broker subs data structures global/shared between conn
  handler tasks
- Register the `tickers2qs` entry *after* instantiating broker client(s)
  (avoids race condition when mulitple client connections are coming
  online simultaneously)
- Push smoke quotes to every client not just the first that connects
- Track quoter tasks in a cross-task set
- Handle unsubscriptions more correctly
2018-04-20 13:18:35 -04:00
Tyler Goodlet 0add443e8b Spawn broker-daemon without asking 2018-04-20 13:18:35 -04:00
Tyler Goodlet 2973b40946 Allow wl app to spawn a broker daemon in a subprocess 2018-04-20 13:18:35 -04:00
Tyler Goodlet 90e8dd911c Daemon main doesn't require brokermod anymore 2018-04-20 13:18:35 -04:00
Tyler Goodlet 4123139750 Use `Client` in watchlist app 2018-04-20 13:18:35 -04:00
Tyler Goodlet 17feb17535 Add a reliable `Client` API
In order to start working toward a HA distributed
architecture make apps use a `Client` type to talk to daemons.
The `Client` provides fault-tolerance for connection failures such
that the app will continue running until a connection to the original
service can be made or the process is killed. This will make it easier
to simply spawn up new daemon child processes when faults are detected.
2018-04-20 13:18:35 -04:00
Tyler Goodlet 4d4c04cd11 Document daemon usage 2018-04-20 13:18:35 -04:00
Tyler Goodlet 51b44cf236 Use msgpack for quote-packet serialization 2018-04-20 11:43:14 -04:00
Tyler Goodlet dd5e1e7ea7 Doh, set sleeptime after adjusting the rate limit 2018-04-20 11:43:14 -04:00
Tyler Goodlet 030ecdcce8 Filter symbols and push initial quote in stream handler
Filter out bad symbols by processing an initial batch quote and
pushing to the subscribing client before spawning a quoter task.
This also avoids exposing the quoter task to anything but the
broker module and a `get_quotes()` routine.
2018-04-20 11:43:14 -04:00
Tyler Goodlet 02a71c51ba Make <brokermod>.quoter() a simple factory func 2018-04-20 11:43:14 -04:00
Tyler Goodlet a6dc697327 Move watchlist app to new daemon-socket api 2018-04-20 11:43:14 -04:00
Tyler Goodlet 0c7ecd383b Monkey patch broker mods with a name attr 2018-04-20 11:43:14 -04:00
Tyler Goodlet 6359623019 Allow broker specific subscriptions
Allow client connections to subscribe for quote streams from specific
brokers and spawn broker-client quoter tasks on-demand according
to client connection demands. Support multiple subscribers to a
single daemon process.
2018-04-20 11:43:14 -04:00
Tyler Goodlet f80735121c Use an async generator inside `StreamQueue`
Async generators are faster and less code. Handle segmented packets
which can happen during periods of high quote volume. Move per-broker
rate limit logic into daemon task.
2018-04-20 11:43:14 -04:00
Tyler Goodlet 4898459bcd Make watchlist app retrieve quotes from the broker daemon 2018-04-20 11:43:14 -04:00
Tyler Goodlet 73ef95f42a Add `pikerd` entry point 2018-04-20 11:43:14 -04:00
Tyler Goodlet 23ae71089f Handle dynamic symbol subscriptions in QT backend 2018-04-20 11:42:59 -04:00
Tyler Goodlet d65bd78f5d Add a quote stream server task
Add a daemon-server task for delivering subscription based
quote streams via json serialized packets wrapped in a queue
interface.
2018-04-16 02:03:22 -04:00
goodboy 07c95e4f3f
Merge pull request #34 from pikers/travis_ci
Travis CI
2018-04-11 14:27:16 -04:00
Tyler Goodlet 1c7db834b7 Add CI badge 2018-04-11 13:46:24 -04:00
Tyler Goodlet a414cbb0c4 Initial travisCI file 2018-04-11 13:46:21 -04:00
Tyler Goodlet 89a151a39c Update lock file 2018-04-11 00:04:34 -04:00
goodboy d4eb5ffb59
Merge pull request #33 from pikers/wl_builtins
Watchlist builtins
2018-04-10 22:31:50 -04:00
Tyler Goodlet 2070f292b1 Update tests 2018-04-10 21:57:28 -04:00
Tyler Goodlet 577ca43c02 Include built-in lists in show, log errors from remove 2018-04-10 14:13:00 -04:00
Tyler Goodlet 381df2815d Expose remove errors to caller 2018-04-10 14:12:06 -04:00
Tyler Goodlet 6b72d04427 Change watchlist write function name 2018-04-06 15:07:47 -04:00
Tyler Goodlet 7e92df4352 Move built-in lists to respective module 2018-04-06 15:00:11 -04:00
Tyler Goodlet 0cccdd01b5 Only log when the network first goes down 2018-04-05 23:15:24 -04:00
goodboy bb44b9854b
Merge pull request #30 from Konstantine00/watchlist_management
Watchlist Management API and Tests
2018-04-04 01:06:58 -04:00
K0nstantine 918133f265 Finalize WL Management and fix merge func 2018-04-04 00:35:12 -04:00
K0nstantine 49b760673e Remove write to file from API and move to CLI 2018-04-04 00:35:12 -04:00
K0nstantine cd69c30143 CLI tests for watchlist commands 2018-04-04 00:35:12 -04:00
K0nstantine 11f25958ba Move watchlist api tests to seperate module 2018-04-04 00:34:42 -04:00
K0nstantine e859222df4 Add initial API test, need relocation 2018-04-04 00:25:34 -04:00
K0nstantine d28a3dc461 Add initial config dir test 2018-04-04 00:25:34 -04:00
K0nstantine ce75bd8f6f Update CLI and create watchlists module
Moved the watchlists management implementation to a seperate module
wrapped in an api.

Resolves: #5
2018-04-04 00:25:34 -04:00
K0nstantine 43fbea5722 Sorted values and keys in watchlist dictionary and added a purge function 2018-04-04 00:25:34 -04:00
K0nstantine 7ada8a291e Initial watchlist management cli 2018-04-04 00:25:34 -04:00
goodboy 397c27e05a
Merge pull request #31 from pikers/tolerate_the_network
Tolerate the network
2018-04-02 16:48:49 -04:00
Tyler Goodlet e246823f2d Add timeout handling to network poll loop 2018-04-02 14:51:38 -04:00
Tyler Goodlet 01cfbbdd64 Handle network outages
Quote queries will hang indefinitely when the network goes down.
Instead poll for network reestablishment such that roaming on
wifi is supported and real-time feeds will resume once the network is
back.
2018-03-31 12:02:22 -04:00
goodboy d527f3383c
Merge pull request #29 from pikers/pipenv
Pipenv!
2018-03-30 16:56:24 -04:00
Tyler Goodlet 2b51e84a3c Expect quotes dict in watchlist update loop 2018-03-29 13:02:03 -04:00