public static bool TryReadAt <T>(this Concurrent <T[]> concurrent, int index, out T value) { using var read = concurrent.Read(); if (index < read.Value.Length) { value = read.Value[index]; return(true); } value = default; return(false); }
public static T[] ReadToArray <T>(this Concurrent <List <T> > concurrent) { using var read = concurrent.Read(); return(read.Value.ToArray()); }
public static T ReadAt <T>(this Concurrent <T[]> concurrent, int index) { using var read = concurrent.Read(); return(read.Value[index]); }
public static int ReadCount <T>(this Concurrent <T> concurrent) where T : ICollection { using var read = concurrent.Read(); return(read.Value.Count); }