Last active
July 22, 2018 15:36
-
-
Save ilgooz/17ca05ab45a398c7bc4f52e5616e021e to your computer and use it in GitHub Desktop.
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
execution := application.NewExecution("v1_yyy", "send") // has Name, Info, Data inputs | |
mapper := application.NewMapper(func(req *application.Request) interface {} { | |
var data eventOutput | |
req.Get(&data) | |
data.Info = "info" | |
return data | |
}) | |
// Wait for request event from v1_xxx service but filter with name=x. | |
// Execute send from v1_yyy with data by mapper. | |
app.WhenEvent("v1_xxx").Event("request").Filter("name", "x").Map(mapper).Execute(execution) | |
type eventOutput struct { | |
Name string | |
Info string | |
Data interface{} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment