Nalix.Framework API Reference

Read time 2 minutes Package: Nalix.Framework
On this page

Nalix.Framework provides the Level 2 runtime services for the Nalix ecosystem, including Native AOT-safe dependency injection, background worker and recurring job management, 64-bit Snowflake identifiers, and pooled memory/object managers.

Dependency Injection & Diagnostics (Nalix.Framework.Injection)

  • Instance Manager (DI) — Lock-free service registry with 2-slot MRU [ThreadStatic] L1 caching, compile-time [Injectable] activators, greedy constructor injection (CreateInstanceWithInjection), and post-startup Lockdown().
  • SingletonBase<T> — Thread-safe generic singleton base backed by Lazy<T> and compile-time SingletonActivatorCache factories (ReportRegistry, PacketRegistryFactory, etc.).
  • ReportRegistry & ReportExtensions (Nalix.Framework, Nalix.Framework.Extensions) — Thread-safe diagnostic report registry (ReportRegistry.Instance.Register<T>(CoreTelemetryTarget, instance), Get<T>(key), GenerateReport(), WriteReportData(Utf8JsonWriter), and IReportable.ToJsonUtf8() / ToJsonString()).
  • DiagnosticsEvents & DiagnosticListenerFactory (Nalix.Environment, Nalix.Codec, Nalix.Framework, Nalix.Network, Nalix.Runtime) — Per-assembly DiagnosticListener sources ("Environment", "Codec", "Framework", "Network", "Runtime") emitting structured DiagnosticLog(Tag, Message, Exception) payloads (with a browser-safe No-Op adapter on WebAssembly).

Background Tasks & Identifiers

  • Task Manager — Multi-gate background worker and recurring job scheduler (ITaskManager) with CPU-aware dynamic concurrency scaling (TaskManagerOptions).
  • WorkerOptions — Per-worker priority, group concurrency limits, retention, OS thread priority, and CPU core affinity.
  • RecurringOptions — Non-reentrant execution, startup jitter, per-run timeout, and exponential backoff settings for recurring jobs.
  • Snowflake — 64-bit sortable identifier (Type + 32-bit Unix seconds Value + 14-bit Sequence + 10-bit MachineId) and SnowflakeOptions.

Memory & Object Pooling (Nalix.Framework.Memory)