Created
May 4, 2015 21:01
-
-
Save gerad/77b64f063a6424f763de to your computer and use it in GitHub Desktop.
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
package echo | |
type Connection interface { | |
Subscribe(string, func(string)) | |
Publish(string, string) | |
} | |
// echo back any message sent to the "/echo" topic | |
func StartEchoProvider(connection Connection) { | |
connection.Subscribe("/echo", func(message string) { | |
connection.Publish("/echo", message) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment