The RemoteSource sample was the only one still using Finam, and it did so
through a NuGet package. That package - like every published connector - is
built against a StockSharp.Messages that still had HistoricalAsyncMessageAdapter,
a type this repository removed, so the sample no longer compiled against its own
sources.
BinanceHistory replaces it. Being open, it is referenced as a project the way the
other samples reference connectors, which also ends the package-versus-sources
mismatch. It is free and keyless, so the web-api token prompt and the
IInstrumentInfoService registration are gone - nothing resolved that service
here, and demanding a token to download public data made no sense. The security
lookup now derives its code from Paths.HistoryDefaultSecurity instead of asking
for BTCUSD while fetching BTCUSDT@BNBFT.
The security get-or-create path was bridged to the async storage through a
blocking AsyncHelper.Run, turning SaveAsync into a sync-over-async call inside
the hot message-processing path. Propagate real async up the whole chain.
TraderHelper:
- Add GetOrCreateAsync that awaits ISecurityStorage.SaveAsync. It does not hold
the storage Lock.Scope across the await (the lock is monitor based and thread
affine); SaveAsync(forced: false) is an atomic add-if-absent, and the
canonical stored instance is re-resolved to stay correct under concurrent
creation.
- Mark the sync GetOrCreate(out bool) obsolete; it bridges to the async variant
and has no internal callers left.
Connector / Connector_ProcessMessage:
- Add GetSecurityAsync/EnsureGetSecurityAsync and route the message-processing
handlers (Security, Level1, News, Quotes, Trade, Transaction, PositionChange,
Execution) through them; the already-async dispatcher awaits them. No blocking
Run remains on this path.
- TryGetSecurity (entity cache snapshot delegate) becomes a pure LookupById: a
snapshot lookup must not create or persist a security.
IConnector:
- Add GetSecurityAsync(SecurityId, CancellationToken) and mark the sync
GetSecurity(SecurityId) obsolete. The sync method stays as a deprecated bridge
for external callers only.
Migrate the in-repo callers (tests and the RemoteSource sample) to the async API.