Skip to content

Commit f43a3fd

Browse files
committed
build fix.
1 parent 28a25c6 commit f43a3fd

20 files changed

Lines changed: 92 additions & 119 deletions

Algo/CollectionSecurityProvider.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// The supplier of information on instruments, getting data from the collection.
75
/// </summary>
@@ -56,7 +54,7 @@ public ValueTask<Security> LookupByIdAsync(SecurityId id, CancellationToken canc
5654

5755
/// <inheritdoc />
5856
public IAsyncEnumerable<Security> LookupAsync(SecurityLookupMessage criteria, CancellationToken cancellationToken)
59-
=> _inner.SyncGet(d => d.Values.Filter(criteria)).ToAsyncEnumerable2(cancellationToken);
57+
=> _inner.SyncGet(d => d.Values.Filter(criteria)).ToAsyncEnumerable();
6058

6159
async ValueTask<SecurityMessage> ISecurityMessageProvider.LookupMessageByIdAsync(SecurityId id, CancellationToken cancellationToken)
6260
=> (await LookupByIdAsync(id, cancellationToken))?.ToMessage();

Algo/FilterableSecurityProvider.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// Provider of information about instruments supporting search using <see cref="SecurityTrie"/>.
75
/// </summary>
@@ -59,7 +57,7 @@ public IAsyncEnumerable<Security> LookupAsync(SecurityLookupMessage criteria, Ca
5957
if (!secId.IsEmpty())
6058
securities = securities.Where(s => s.Id.EqualsIgnoreCase(secId));
6159

62-
return securities.Filter(criteria).TryLimitByCount(criteria).ToAsyncEnumerable2(cancellationToken);
60+
return securities.Filter(criteria).TryLimitByCount(criteria).ToAsyncEnumerable();
6361
}
6462

6563
async ValueTask<SecurityMessage> ISecurityMessageProvider.LookupMessageByIdAsync(SecurityId id, CancellationToken cancellationToken)

Algo/Storages/Csv/CsvEntityRegistry.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo.Storages.Csv;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// The CSV storage of trading objects.
75
/// </summary>
@@ -137,7 +135,7 @@ IAsyncEnumerable<Security> ISecurityProvider.LookupAsync(SecurityLookupMessage c
137135
arr = security == null ? [] : [security];
138136
}
139137

140-
return arr.ToAsyncEnumerable2(cancellationToken);
138+
return arr.ToAsyncEnumerable();
141139
}
142140

143141
ValueTask<SecurityMessage> ISecurityMessageProvider.LookupMessageByIdAsync(SecurityId id, CancellationToken cancellationToken)

Algo/Storages/ISecurityStorage.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo.Storages;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// The interface for access to the storage of information on instruments.
75
/// </summary>
@@ -154,7 +152,7 @@ public ValueTask DeleteRangeAsync(IEnumerable<Security> securities, Cancellation
154152

155153
/// <inheritdoc />
156154
public IAsyncEnumerable<Security> LookupAsync(SecurityLookupMessage criteria, CancellationToken cancellationToken)
157-
=> _inner.SyncGet(d => d.Values.Filter(criteria).ToArray()).Concat(_underlying.Lookup(criteria)).Distinct().ToAsyncEnumerable2(cancellationToken);
155+
=> _inner.SyncGet(d => d.Values.Filter(criteria).ToArray()).Concat(_underlying.Lookup(criteria)).Distinct().ToAsyncEnumerable();
158156

159157
/// <inheritdoc />
160158
public ValueTask<Security> LookupByIdAsync(SecurityId id, CancellationToken cancellationToken)

Algo/Storages/InMemoryMarketDataStorage.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo.Storages;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// The storage, generating data in the process of operation.
75
/// </summary>
@@ -56,7 +54,7 @@ public InMemoryMarketDataStorage(SecurityId securityId, object arg, Func<DateTim
5654

5755
/// <inheritdoc />
5856
public IAsyncEnumerable<T> LoadAsync(DateTime date, CancellationToken cancellationToken)
59-
=> _getData(date).ToAsyncEnumerable2(cancellationToken);
57+
=> _getData(date).ToAsyncEnumerable();
6058

6159
IAsyncEnumerable<Message> IMarketDataStorage.LoadAsync(DateTime date, CancellationToken cancellationToken) => LoadAsync(date, cancellationToken);
6260

Algo/Storages/LocalMarketDataDrive.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ namespace StockSharp.Algo.Storages;
33
using IOPath = System.IO.Path;
44

55
using Ecng.Reflection;
6-
using Ecng.Linq;
76

87
using StockSharp.Algo.Storages.Binary;
98

@@ -43,7 +42,7 @@ public LocalMarketDataStorageDrive(DataType dataType, SecurityId secId, StorageF
4342
_datesPathObsoleteBin = $"{datesPath}.bin";
4443
_datesPathObsoleteTxt = $"{datesPath}.txt";
4544

46-
_datesDict = new Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>>(() =>
45+
_datesDict = new(() =>
4746
{
4847
var retVal = new CachedSynchronizedOrderedDictionary<DateTime, DateTime>();
4948

@@ -83,15 +82,15 @@ public LocalMarketDataStorageDrive(DataType dataType, SecurityId secId, StorageF
8382
SaveDates(retVal.CachedValues);
8483

8584
return retVal;
86-
}).Track();
85+
});
8786
}
8887

8988
private readonly LocalMarketDataDrive _drive;
9089
IMarketDataDrive IMarketDataStorageDrive.Drive => _drive;
9190

9291
ValueTask<IEnumerable<DateTime>> IMarketDataStorageDrive.GetDatesAsync(CancellationToken cancellationToken) => new(DatesDict.CachedValues);
9392

94-
private readonly Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>> _datesDict;
93+
private readonly ResettableLazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>> _datesDict;
9594
private CachedSynchronizedOrderedDictionary<DateTime, DateTime> DatesDict => _datesDict.Value;
9695

9796
ValueTask IMarketDataStorageDrive.ClearDatesCacheAsync(CancellationToken cancellationToken)
@@ -771,7 +770,7 @@ private bool TryGetIndex(out Index index)
771770
/// </summary>
772771
[Obsolete("Use GetAvailableSecuritiesAsync instead.")]
773772
public IEnumerable<SecurityId> AvailableSecurities
774-
=> AsyncHelper.Run(() => GetAvailableSecuritiesAsync(default).ToArrayAsync2(default));
773+
=> AsyncHelper.Run(() => GetAvailableSecuritiesAsync(default).ToArrayAsync(default));
775774

776775
/// <inheritdoc />
777776
public override async IAsyncEnumerable<SecurityId> GetAvailableSecuritiesAsync([EnumeratorCancellation]CancellationToken cancellationToken)

Algo/Storages/MarketDataStorage.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo.Storages;
22

3-
using Ecng.Linq;
4-
53
using Nito.AsyncEx;
64

75
abstract class MarketDataStorage<TMessage, TId> : IMarketDataStorage<TMessage>

Algo/Storages/MarketDataStorageCache.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
namespace StockSharp.Algo.Storages;
22

3-
using Ecng.Linq;
4-
53
/// <summary>
64
/// <see cref="IMarketDataStorage"/> cache.
75
/// </summary>
@@ -54,7 +52,7 @@ public async IAsyncEnumerable<Message> GetMessagesAsync<TEnumerable>(SecurityId
5452

5553
if (!_cache.TryGetValue(key, out var t))
5654
{
57-
var data = await loadIfNeed(date, cancellationToken).ToArrayAsync2(cancellationToken);
55+
var data = await loadIfNeed(date, cancellationToken).ToArrayAsync(cancellationToken);
5856
t = (now, data.ToArray());
5957

6058
if (_cache.Count > Limit)

Algo/Storages/SnapshotRegistry.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public SnapshotStorage(string path, ISnapshotSerializer<TKey, TMessage> serializ
267267
_fileNameWithExtension = _serializer.Name.ToLowerInvariant() + ".bin";
268268
_datesPath = Path.Combine(_path, _serializer.Name + "Dates.txt");
269269

270-
_datesDict = new Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>>(() =>
270+
_datesDict = new(() =>
271271
{
272272
var retVal = new CachedSynchronizedOrderedDictionary<DateTime, DateTime>();
273273

@@ -290,12 +290,12 @@ public SnapshotStorage(string path, ISnapshotSerializer<TKey, TMessage> serializ
290290
}
291291

292292
return retVal;
293-
}).Track();
293+
});
294294
}
295295

296296
public override IEnumerable<DateTime> Dates => DatesDict.CachedValues;
297297

298-
private readonly Lazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>> _datesDict;
298+
private readonly ResettableLazy<CachedSynchronizedOrderedDictionary<DateTime, DateTime>> _datesDict;
299299

300300
private CachedSynchronizedOrderedDictionary<DateTime, DateTime> DatesDict => _datesDict.Value;
301301

Algo/Storages/StorageHelper.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ namespace StockSharp.Algo.Storages;
22

33
using System.Diagnostics;
44

5-
using Ecng.Linq;
6-
75
using StockSharp.Algo.Candles;
86
using StockSharp.Algo.Candles.Compression;
97

@@ -133,7 +131,7 @@ public RangeEnumerable(IMarketDataStorage<TData> storage, DateTime from, DateTim
133131
public static IEnumerable<TMessage> Load<TMessage>(this IMarketDataStorage<TMessage> storage, DateTime? from = null, DateTime? to = null)
134132
where TMessage : Message, IServerTimeMessage
135133
{
136-
return AsyncHelper.Run(() => LoadAsync(storage, from, to).ToArrayAsync2(default));
134+
return AsyncHelper.Run(() => LoadAsync(storage, from, to).ToArrayAsync(default));
137135
}
138136

139137
/// <summary>
@@ -227,7 +225,7 @@ public static async ValueTask<bool> DeleteAsync(this IMarketDataStorage storage,
227225
}
228226
else
229227
{
230-
var data = (await storage.LoadAsync(date, cancellationToken).ToArrayAsync2(cancellationToken)).ToList();
228+
var data = (await storage.LoadAsync(date, cancellationToken).ToArrayAsync(cancellationToken)).ToList();
231229
data.RemoveWhere(d =>
232230
{
233231
var t = d.GetServerTime();
@@ -240,7 +238,7 @@ public static async ValueTask<bool> DeleteAsync(this IMarketDataStorage storage,
240238
await storage.DeleteAsync(date, cancellationToken);
241239
else
242240
{
243-
var data = (await storage.LoadAsync(date, cancellationToken).ToArrayAsync2(cancellationToken)).ToList();
241+
var data = (await storage.LoadAsync(date, cancellationToken).ToArrayAsync(cancellationToken)).ToList();
244242
data.RemoveWhere(d => d.GetServerTime() > range.Max);
245243
await storage.DeleteAsync(data, cancellationToken);
246244
}
@@ -518,7 +516,7 @@ public async IAsyncEnumerable<CandleMessage> LoadAsync(DateTime date, [Enumerato
518516

519517
if (dates.Contains(date))
520518
{
521-
var data = await s.LoadAsync(date, cancellationToken).ToArrayAsync2(cancellationToken);
519+
var data = await s.LoadAsync(date, cancellationToken).ToArrayAsync(cancellationToken);
522520
storagesWithData.Add((s, data));
523521
}
524522
}
@@ -1609,7 +1607,7 @@ public static IEnumerable<Message> Load(this IMarketDataStorage storage, DateTim
16091607
if (storage is null)
16101608
throw new ArgumentNullException(nameof(storage));
16111609

1612-
return AsyncHelper.Run(() => storage.LoadAsync(date, default).ToArrayAsync2(default));
1610+
return AsyncHelper.Run(() => storage.LoadAsync(date, default).ToArrayAsync(default));
16131611
}
16141612

16151613
/// <summary>
@@ -1677,6 +1675,6 @@ public static IEnumerable<TMessage> Load<TMessage>(this IMarketDataStorage<TMess
16771675
if (storage is null)
16781676
throw new ArgumentNullException(nameof(storage));
16791677

1680-
return AsyncHelper.Run(() => storage.LoadAsync(date, default).ToArrayAsync2(default));
1678+
return AsyncHelper.Run(() => storage.LoadAsync(date, default).ToArrayAsync(default));
16811679
}
16821680
}

0 commit comments

Comments
 (0)