aboutsummaryrefslogtreecommitdiff
path: root/lib/VNLib.Data.Caching.ObjectCache
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNLib.Data.Caching.ObjectCache')
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheLIstener.cs6
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/src/ICacheListenerEventQueue.cs3
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheLIstener.cs b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheLIstener.cs
index 0fe0663..d69c6bb 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheLIstener.cs
+++ b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheLIstener.cs
@@ -160,21 +160,21 @@ namespace VNLib.Data.Caching.ObjectCache
}
//Determine if the queue is enabled for the user
- if(!EventQueue.IsEnabled(userState!))
+ if(!EventQueue.IsEnabled(userState))
{
context.CloseResponse(ResponseCodes.NotFound);
return;
}
//try to deq without awaiting
- if (EventQueue.TryDequeue(userState!, out ChangeEvent? change))
+ if (EventQueue.TryDequeue(userState, out ChangeEvent? change))
{
SetResponse(change, context);
}
else
{
//Wait for a new message to process
- ChangeEvent ev = await EventQueue.DequeueAsync(userState!, exitToken);
+ ChangeEvent ev = await EventQueue.DequeueAsync(userState, exitToken);
//Set the response
SetResponse(ev, context);
diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/ICacheListenerEventQueue.cs b/lib/VNLib.Data.Caching.ObjectCache/src/ICacheListenerEventQueue.cs
index 06be4fa..439de94 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/src/ICacheListenerEventQueue.cs
+++ b/lib/VNLib.Data.Caching.ObjectCache/src/ICacheListenerEventQueue.cs
@@ -25,6 +25,7 @@
using System.Threading;
using System.Threading.Tasks;
+using System.Diagnostics.CodeAnalysis;
namespace VNLib.Data.Caching.ObjectCache
{
@@ -38,7 +39,7 @@ namespace VNLib.Data.Caching.ObjectCache
/// </summary>
/// <param name="userState">The unique state of the connection</param>
/// <returns>True if event queuing is enabled</returns>
- bool IsEnabled(object userState);
+ bool IsEnabled([NotNullWhen(true)] object? userState);
/// <summary>
/// Attempts to dequeue a single event from the queue without blocking