Skip to content

Instantly share code, notes, and snippets.

@gerad
Created May 4, 2015 21:01
Show Gist options
  • Save gerad/77b64f063a6424f763de to your computer and use it in GitHub Desktop.
Save gerad/77b64f063a6424f763de to your computer and use it in GitHub Desktop.
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