mirror of
https://github.com/bitwarden/server
synced 2025-12-19 09:43:25 +00:00
connection counter
This commit is contained in:
29
src/Notifications/ConnectionCounter.cs
Normal file
29
src/Notifications/ConnectionCounter.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Threading;
|
||||
|
||||
namespace Bit.Notifications
|
||||
{
|
||||
public class ConnectionCounter
|
||||
{
|
||||
private int _count = 0;
|
||||
|
||||
public void Increment()
|
||||
{
|
||||
Interlocked.Increment(ref _count);
|
||||
}
|
||||
|
||||
public void Decrement()
|
||||
{
|
||||
Interlocked.Decrement(ref _count);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
public int GetCount()
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user