Created
August 26, 2018 08:36
-
-
Save vincent6767/f106803aac9acdea4473e76673636951 to your computer and use it in GitHub Desktop.
Channel: Passing data to another Goroutine example
This file contains 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
type MatchMaker {} | |
func (m *MatchMaker) CreateMatch(game *Game, party *Party) bool { | |
var serverStatusChan chan bool | |
gameSessionStatusChan := m.RequestGameSession(game, party) // gameSessionStatusChan returns a channel for signaling the status request. | |
fmt.Println(“Trying to request game session . . .”) | |
return <- serverStatusChan // It returns whatever the result asynchronous result operation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment