2.7 KiB
2.7 KiB
Why
The AssetAZ Ticker currently owns a hardcoded price generator, so acquisition, scheduling, persistence, and publication are coupled in one implementation. Nenjim's future component model constructs components independently and lets a component obtain peer plugins from its context after construction, so price sources must be independently constructible and wired to the ticker only when the ticker starts them.
What Changes
- Add
PriceSourceand functionalPriceSinkAPI contracts in which independently constructed sources receive their sink throughstart(PriceSink)and own their acquisition resources. - Keep plugin discovery and lifecycle inside
TickerServiceImpl: it obtainsPriceSourceimplementations from its Nenjim context, starts them with itself as sink, and stops them. OrdinaryTickerServiceclients receive no plugin-management API. - Add the
ΩPriceSourceNameΩValueTag and include stable source identity in each in-memoryPriceObservation. - BREAKING Replace the single history file with an independent UUID-based history path for each obtained
(TradingPair, sourceName)source identity; the old file is not migrated automatically. - Refactor
TickerServiceImplinto a source-agnostic sink that validates callbacks, persists each source independently, and publishes the greatest successfully persisted timestamp across active sources for a pair. - Move the existing
EVE_USDC = 14.85generation and fixed-delay scheduler into a stoppableHardcodedPriceSourceplugin. - Use a temporary
TickerServiceImpl(PriceSource...)Cauldron constructor to simulate the future Nenjim context lookup while constructingHardcodedPriceSourceindependently.
Capabilities
New Capabilities
None.
Modified Capabilities
assetaz-ticker-service: Generalize the ticker from one internal generator and history into context-provided source plugins with per-source activation, persistence, lifecycle, and cross-source latest selection.
Impact
- Changes the AssetAZ ticker plugin API and reference implementation under
com.r35157.assetaz.core.service.ticker; the ordinaryTickerServiceAPI exposes lifecycle and price queries, not plugin registration. - Adds
PriceSourceNameto the shared Detag hierarchy underString -> Name; this configuration change is explicitly required by issue #61. - Changes the operator-managed history location and requires manual movement of the old hardcoded history.
- Updates temporary wiring in
NenjimHubImplto construct the source and ticker independently before injecting the source list as a stand-in for future context discovery. - Adds no Raydium, WebSocket, history-query, retention, or automated-test functionality.