Skip to content

Commit ed485ac

Browse files
committed
firing event when data is enqueued
1 parent e0db677 commit ed485ac

File tree

1 file changed

+4
-0
lines changed
  • src/dds.net-connector-csharp.lib/Interfaces/SyncQueue

1 file changed

+4
-0
lines changed

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

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

22+
public event Action? DataAvailable;
23+
2224
/// <summary>
2325
/// Initializes queue with specified size.
2426
/// </summary>
@@ -113,6 +115,8 @@ public void Enqueue(T data)
113115

114116
Thread.Sleep(SLEEP_TIME_MS_WHEN_DATA_CANNOT_BE_ENQUEUED);
115117
}
118+
119+
DataAvailable?.Invoke();
116120
}
117121

118122
public void Clear()

0 commit comments

Comments
 (0)