ResearchCave Technology

ResearchCave.Presence (1.1.48)

Published 2026-07-28 15:46:00 +03:00 by admin

Installation

dotnet nuget add source --name ResearchCave --username your_username --password your_token http://git.researchcave.com/api/packages/ResearchCave/nuget/index.json
dotnet add package --source ResearchCave --version 1.1.48 ResearchCave.Presence

About this package

Fast, distributed ASP.NET Core presence recording and snapshots for ResearchCave services using Redis or Microsoft Garnet.

ResearchCave.Presence

Distributed, failure-tolerant presence recording for ASP.NET Core microservices. It supports Redis and Microsoft Garnet through StackExchange.Redis.

builder.Services.AddResearchCavePresence(
    builder.Configuration,
    options =>
    {
        options.ServiceName = "Sentient";
        options.ConnectionStringName = "Redis";
        options.KeyPrefix = "presence";
        options.UpdateInterval = TimeSpan.FromSeconds(30);
        options.PresenceTtl = TimeSpan.FromMinutes(2);
        options.MaximumUserAgentLength = 512;
    });

Configure the shared connection in the standard configuration location:

{
  "ConnectionStrings": {
    "Redis": "localhost:6379"
  }
}

When neither the named connection string nor an application-registered IConnectionMultiplexer is available, presence is disabled, startup logs one warning, HTTP requests continue normally, and snapshots are empty.

Place public static-file handling before presence, and presence after authentication:

app.UseStaticFiles();
app.UseAuthentication();
app.UseAuthorization();
app.UseResearchCavePresence();

The default IP resolver uses only HttpContext.Connection.RemoteIpAddress. Applications behind Cloudflare or another trusted proxy can replace IPresenceIpAddressResolver through dependency injection after configuring their trusted proxy boundary.

Inject IPresenceService or PresenceService to obtain a best-effort snapshot of raw active records. Authenticated results are session-aware, so one sub can appear more than once. Profile lookup and grouping belong to the consuming service.

Dependencies

ID Version Target Framework
StackExchange.Redis 3.0.17 net10.0
Details
NuGet
2026-07-28 15:46:00 +03:00
1
ResearchCave
40 KiB
Assets (2)
Versions (1) View all
1.1.48 2026-07-28