mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-07-30 17:30:40 +00:00
24 lines
428 B
C#
24 lines
428 B
C#
using Esiur.Resource;
|
|
using System.Threading;
|
|
|
|
namespace Esiur.Tests.Unit.Integration;
|
|
|
|
[Resource]
|
|
public partial class RateLimitedResource
|
|
{
|
|
int _callCount;
|
|
int _value;
|
|
|
|
[Export]
|
|
[RateControl("standard-call")]
|
|
public int Call() => Interlocked.Increment(ref _callCount);
|
|
|
|
[Export]
|
|
[RateControl("standard-set")]
|
|
public int Value
|
|
{
|
|
get => _value;
|
|
set => _value = value;
|
|
}
|
|
}
|