Skip to content

About

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

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

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

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages