public class SimplifiedKubeLogic // This is the simplified logic of the class Kube where I removed everything unnecessary and kept only the modification of the list from different threads.
{
private readonly List<SampleService> _services;
private volatile int _index = 0;
public SimplifiedKubeLogic()
{
_services = new List<SampleService>();
}
public virtual async Task<List<SampleService>> GetAsync()
{
await Task.Yield();
_services.Clear();
_services.AddRange(new[] { new SampleService { Host = Interlocked.Increment(ref _index) } });
return _services;
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
antikorol/incorrect-list-usage-sample
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published