Skip to content

Instantly share code, notes, and snippets.

@asticode
Last active December 2, 2017 15:13
Show Gist options
  • Save asticode/a7ac6adde4b538ebffa294cebbe3c625 to your computer and use it in GitHub Desktop.
Save asticode/a7ac6adde4b538ebffa294cebbe3c625 to your computer and use it in GitHub Desktop.
// This will send a message and execute a callback
// Callbacks are optional
bootstrap.SendMessage(w, "event.name", "hello", func(m *bootstrap.MessageIn) {
// Unmarshal payload
var s string
json.Unmarshal(m.Payload, &s)
// Process message
log.Infof("received %s", s)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment