Skip to content

Collections

A handful of data structures and LINQ-like extensions that the BCL doesn't give you out of the box. Everything here is either (a) a collection with a specific behaviour you'd otherwise reinvent, or (b) a tiny extension that saves you a one-liner you write on every project.

Pages in this section

  • Circular Queue — fixed-capacity FIFO that drops the oldest item when full. Ring buffer without the fuss.
  • Handler Registry — predicate/action pairs with first-match or all-match dispatch and a stash/pop mechanism for testing.
  • Type RegistryType-keyed dictionary with GetOrAdd semantics; the backbone of pluggable systems.
  • Lazy Value Cache — memory-cached lazy initialisation with per-entry expiration.
  • ExtensionsEnumerableExtensions, CollectionExtensions, AsyncEnumerableExtensions and the InsertAt helpers.

Namespace map

NamespaceTypes
Servus.CollectionsCircularQueue<T>, HandlerRegistry, TypeRegistry<TValue>, LazyValueCache<TKey,TValue>, InsertionBehavior, AsyncEnumerableExtensions
ServusCollectionExtensions, EnumerableExtensions, EnumerableExtensions.Insert

Servus and happy coding! 🥨🍺