Last active
August 29, 2015 14:05
-
-
Save yifan-gu/dd93556cebebd655207c to your computer and use it in GitHub Desktop.
continuation
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
func processLoop() { | |
for { | |
// process the next event. | |
} | |
} | |
func (f *foo) a () { | |
// check a bunch of assumptions. | |
go func () { | |
// b is a time consuming func, it returns a chan. | |
future = b() | |
<-future | |
// put f.aa() in processing loop. | |
} | |
} | |
func (f *foo) aa () { | |
// check a bunch of assumptions again!! | |
// continue the work of f.a(). | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment