Skip to content

SpenceSellers/Async-Answer-From-Future

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Async-Answer-From-Future

A demo that abuses C# Async internals to pull a value from the "future".

var answerFromFuture = new AnswerFromFuture();

// Resolve a number that's going to magically avoid hitting .Nope()
var n = await answerFromFuture;

if (n % 10 != 0)
{
    answerFromFuture.Nope();
}

if (n < 55)
{
    answerFromFuture.Nope();
}

Console.Out.WriteLine($"Answer is {n}");
// Prints "Answer is 60"

About

Abuses C# Async internals to pull a value from the "future"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages