Created
March 26, 2020 23:51
-
-
Save Varriount/ceb2675686d9ed1c008017dabf81a5ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async proc foo(i: int) int = | |
await bar(i) // gives i+1 | |
await bar(i+1) // gives i+2 | |
await bar(i+2) // gives i+3 | |
# To | |
proc foo(state: var State) = | |
if state.state == 1: | |
state.waiting_on = bar(state.bar_state, state.i) | |
if state.state == 2: | |
state.waiting_on = bar(state.bar_state, state.i + 2) | |
if state.state == 3: | |
state.waiting_on = bar(state.bar_state, state.i + 3) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment