Skip to content

Instantly share code, notes, and snippets.

@Krumelur
Last active August 29, 2015 14:26
Show Gist options
  • Save Krumelur/3f93afb50b02fba6a7c8 to your computer and use it in GitHub Desktop.
Save Krumelur/3f93afb50b02fba6a7c8 to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
namespace TestOp
{
class MainClass
{
public static void Main (string[] args)
{
var foo = new foo();
foo.Run();
Console.ReadLine();
}
}
public class foo
{
string token;
public foo ()
{
this.token = "Initial Value";
}
Task DoIt(string someString)
{
return Task.Delay(0).ContinueWith(t => Console.WriteLine("SomeString is '{0}'", someString));
}
async Task Execute(Func<Task> op)
{
await op();
}
public async void Run()
{
var op = DoIt(this.token);
this.token = "Changed value";
await Execute(() => op);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment