Esempio n. 1
0
func Put(msg gotocol.Message, name string, listener chan gotocol.Message, requestor *map[string]gotocol.Routetype, router *ribbon.Router) {
	// pass on request to a random service - client send
	c := router.Random()
	if c == nil {
		return
	}
	outmsg := gotocol.Message{gotocol.Put, listener, time.Now(), msg.Ctx.NewParent(), msg.Intention}
	flow.AnnotateSend(outmsg, name)
	outmsg.GoSend(c)
}
Esempio n. 2
0
func GetRequest(msg gotocol.Message, name string, listener chan gotocol.Message, requestor *map[string]gotocol.Routetype, router *ribbon.Router) {
	// pass on request to a random service - client send
	c := router.Random()
	if c == nil {
		return
	}
	outmsg := gotocol.Message{gotocol.GetRequest, listener, time.Now(), msg.Ctx.NewParent(), msg.Intention}
	flow.AnnotateSend(outmsg, name)
	(*requestor)[outmsg.Ctx.Route()] = msg.Route() // remember where to respond to when this span comes back
	outmsg.GoSend(c)
}