example-feed-auto-gc
v0.0.1
Published
This package demonstrates an advanced usage of the `@thinkalpha/feed-cache` library with automatic garbage collection and snapshot requests.
Readme
example-feed-auto-gc
This package demonstrates an advanced usage of the @thinkalpha/feed-cache library with automatic garbage collection and snapshot requests.
Features
- Automatic Garbage Collection: Manages quote lifecycle and cleans up unused quotes.
- Snapshot Requests: Periodically requests snapshots for specified symbols.
- Subscribable Quotes: Extends the base quote functionality to support subscription states.
Installation
To install dependencies, run:
pnpm installRunning the Example
To run the example locally:
pnpm startThis will start the application, connect to the quote server, and begin processing quotes for 'AAPL' and 'TSLA'.
Project Structure
src/run.ts: Entry point of the application.src/QuotesStore.ts: Implementation of the quote store.src/SubscribableQuote.ts: Extended quote class with subscription logic.src/SnapshotRequester.ts: Helper class for requesting snapshots and running GC.
