c# Blocking Collection and Threading
问题 I'm new to using Blocking Collection and threading and want to make sure I'm following best practice. I'm using a third party API that is not thread safe. I will be making multiple simultaneous requests to the API, so I need to add these requests to a queue and process them one after another. To do this I have a blocking collection: BlockingCollection<myEventArgs> myTasks = new BlockingCollection<myEventArgs>(); private void myEventHandler(object sender, myEventArgs e) { myTasks.Add(e); }