How async/await will change our world.
Cool, interesting, quite easy to read and a really interesting experiment, for me, in writing a complex and intellisense driven fluent interface…public void Do()
{
AsyncWorker.Using( this.Id )
.Configure( cfg =>
{
cfg.Before = e =>
{
this.Status = "Running: " + e.Argument;
};
cfg.After = e =>
{
this.Status = "Completed: " + e.Argument;
};
} )
.Execute( e =>
{
//something long running...
Thread.Sleep( 2000 );
} );
}
But…
…in a few months everything will drastically change:
Amazingpublic async void Do()
{
this.Status = "Running: " + this.Id;
await Task.Factory.StartNew( () =>
{
//something long running...
Thread.Sleep( 2000 );
} );
this.Status = "Completed: " + this.Id;
}
.m