Skip to content

Instantly share code, notes, and snippets.

@programmation
Last active August 29, 2015 14:20
Show Gist options
  • Save programmation/993eee805c6f837bb230 to your computer and use it in GitHub Desktop.
Save programmation/993eee805c6f837bb230 to your computer and use it in GitHub Desktop.
Async no-op
// http://blog.stephencleary.com/2015/04/a-tour-of-task-part-10-promise-tasks.html
interface IPlugin
{
// Permit each plugin to initialize asynchronously.
Task InitializeAsync();
}
class MyPlugin : IPlugin
{
public Task InitializeAsync()
{
// The async equivalent of a noop.
return Task.FromResult<object>(null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment