About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Supporting Arbitrary Control Flow

Because you can use await expressions in (mostly) every expression context, their containing asynchronous methods can be paused in the middle of complex control flow constructs, as well. For example, an await expression may occur in the middle of a loop, requiring the method to be paused and resumed at that very point, without causing additional iterations and whatnot.

Although this seems a complex undertaking, it’s not much more complicated than the simple example with linear statement sequencing shown in the previous section. The reason is rather straightforward. At the end of the day, complex control flow structures like conditional statements, loops, and so on are nothing but branch instructions in disguise. ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required