Skip to content

Lightweight C# implementation of FIFO serial queue from ObjC.

License

Notifications You must be signed in to change notification settings

jonbaine/SerialQueue

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SerialQueue

Lightweight C# implementation of FIFO serial queues from ObjC, which is often much better to use for synchronization rather than locks - it doesn't block caller's thread, and than creating new thread - it uses thread pool.

private readonly SerialQueue queue = new SerialQueue();

async Task SomeAsyncMethod()
{
  // C# 5
  var result = await queue.Enqueue(LongRunningWork);

  // Old approach
  queue.Enqueue(LongRunningWork).ContinueWith(t => {
      var result = t.Result;
  })
}

About

Lightweight C# implementation of FIFO serial queue from ObjC.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%