Skip to content

Commit 27db86b

Browse files
committed
enqueue invokes event handlers for data availability
1 parent ed485ac commit 27db86b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dds.net-connector-csharp.lib/Interfaces/SyncQueue/SyncQueueValuetype.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ internal class SyncQueueValuetype<T>
2020
private int _nextWriteIndex;
2121
private int _nextReadIndex;
2222

23+
public event Action? DataAvailable;
24+
2325
/// <summary>
2426
/// Initializes queue with specified size.
2527
/// </summary>
@@ -93,6 +95,8 @@ public void Enqueue(T data)
9395
if (_nextWriteIndex == _queue.Length)
9496
_nextWriteIndex = 0;
9597
}
98+
99+
DataAvailable?.Invoke();
96100
}
97101

98102
public void Dispose()

0 commit comments

Comments
 (0)