Short Walks — Object Locking in C#

#ICYMI: While playing with Azure Event Hubs, I decided that I wanted to implement a thread locking mechanism that didn’t queue. That is, I want to try and get a lock on the resource, and if it’s currently in use, just forget it and move on. The default behavior in C# is to wait for the resource. For example, consider my method: static async Task MyProcedure() { Console.WriteLine($“Test1 {DateTime.Now}”); await Task.Delay(5000); Console.WriteLine($“Test2 {DateTime.Now}”); }

I could execute this five times like so: https://goo.gl/gbWsV4 #DataIntegration #ML