examples/razorwire-mvc/Services/InMemoryUserPresenceService.cs

InMemoryUserPresenceService

Type

InMemoryUserPresenceService

An in-memory implementation of using a thread-safe dictionary to track user activity.
Method

RecordActivity(string)

Records the current UTC time as the specified user's last activity in the in-memory store.
Method

GetActiveUsers()

Lists users whose last recorded activity falls within the current ActiveWindow.
Method

Pulse()

Removes users whose last activity is older than the sliding ActiveWindow and returns the removed entries along with the current count of active users.