C
C#2y ago
exergist

✅ Sequentially Queueing and Processing Async Messages

I have a websocket connection between two applications. I need to have one of the applications process received messages sequentially (finish processing first message before starting on second message). The receiving application has a single method where all received messages are processed. Assuming I can asynchronously collect received messages, how can I queue them for sequential processing based on the order they were received? Thank you!
5 Replies
exergist
exergistOP2y ago
Ooo I'll give that a try!
exergist
exergistOP2y ago
Thanks again @Doombox! I found these resources quite helpful on the subject: https://dotnetpattern.com/csharp-concurrentqueue https://github.com/YounesCheikh/ObservableConcurrentQueue
dotnetpattern.com
ConcurrentQueue in C# - Introduction and Examples
C# ConcurrentQueue is a thread-safe collection class. It is introduced in .NET 4.0 with other concurrent collection classes. Thread-safe FIFO data structure.
GitHub
GitHub - YounesCheikh/ObservableConcurrentQueue: Using System.Colle...
Using System.Collections.Concurrent.ConcurrentQueue with notifications - GitHub - YounesCheikh/ObservableConcurrentQueue: Using System.Collections.Concurrent.ConcurrentQueue with notifications
exergist
exergistOP2y ago
!done what is the right way to close this thread?
Denis
Denis2y ago
/close
Want results from more Discord servers?
Add your server