diff options
author | vnugent <public@vaughnnugent.com> | 2023-03-09 01:48:39 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-03-09 01:48:39 -0500 |
commit | ec99d0c948733ea379065e0ae37ab7702a1e4727 (patch) | |
tree | 31db8b37a7850e56d64365d13cc276596c91f073 /lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs | |
parent | 282aad617b9c39a6f14c1cf527f6dd4523d0c54b (diff) |
Omega cache, session, and account provider complete overhaul
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs')
-rw-r--r-- | lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs b/lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs index e8f071e..139a3ac 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/Events/AsyncIntervalAttribute.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Plugins.Extensions.Loading @@ -36,12 +36,46 @@ namespace VNLib.Plugins.Extensions.Loading.Events internal readonly TimeSpan Interval; /// <summary> - /// Intializes the <see cref="AsyncIntervalAttribute"/> with the specified timeout in milliseconds + /// Initializes a new <see cref="AsyncIntervalAttribute"/> with allowing + /// a configurable /// </summary> - /// <param name="milliseconds">The interval in milliseconds</param> - public AsyncIntervalAttribute(int milliseconds) + public AsyncIntervalAttribute() + {} + + /// <summary> + /// Gets or sets the interval in seconds. Choose only ONE internval resolution + /// </summary> + public int Seconds + { + get => (int)Interval.TotalSeconds; + init => Interval = TimeSpan.FromSeconds(value); + } + + /// <summary> + /// Gets or sets the interval in milliseconds. Choose only ONE internval resolution + /// </summary> + public int MilliSeconds + { + get => (int)Interval.TotalMilliseconds; + init => Interval = TimeSpan.FromMilliseconds(value); + } + + /// <summary> + /// Gets or sets the interval in minutes. Choose only ONE internval resolution + /// </summary> + public int Minutes + { + get => (int)Interval.TotalMinutes; + init => Interval = TimeSpan.FromMinutes(value); + } + + /// <summary> + /// Gets or sets the interval in hours. Choose only ONE internval resolution + /// </summary> + public int Hours { - Interval = TimeSpan.FromMilliseconds(milliseconds); + get => (int)Interval.TotalMinutes; + init => Interval = TimeSpan.FromHours(value); } } } |