Skip to content
Snippets Groups Projects
Commit 1439f131 authored by Jonah Husson's avatar Jonah Husson
Browse files

Use pointer to response object

parent 80dc6980
No related branches found
No related tags found
3 merge requests!510Release,!226WIP: Api2.0,!207WIP: Client Restructure
......@@ -46,7 +46,7 @@ func (s *Request) Request(method restlike.Method, path restlike.URI,
cb := func(msg *restlike.Message) {
signalChannel <- msg
}
s.Net.RegisterListener(catalog.XxMessage, response{responseCallback: cb})
s.Net.RegisterListener(catalog.XxMessage, &response{responseCallback: cb})
// Transmit the Message
_, _, _, err = s.Net.SendE2E(catalog.XxMessage, msg, e2eParams)
......@@ -81,7 +81,7 @@ func (s *Request) AsyncRequest(method restlike.Method, path restlike.URI,
}
// Build callback for the response
s.Net.RegisterListener(catalog.XxMessage, response{responseCallback: cb})
s.Net.RegisterListener(catalog.XxMessage, &response{responseCallback: cb})
// Transmit the Message
_, _, _, err = s.Net.SendE2E(catalog.XxMessage, msg, e2eParams)
......
......@@ -31,7 +31,7 @@ func TestSingleResponse_Callback(t *testing.T) {
Error: "",
}
r := response{cb}
r := &response{cb}
testPayload, err := proto.Marshal(testMessage)
if err != nil {
......@@ -61,7 +61,7 @@ func TestSingleResponse_Callback_ProtoErr(t *testing.T) {
cb := func(input *restlike.Message) {
resultChan <- input
}
r := response{cb}
r := &response{cb}
r.Hear(receive.Message{Payload: []byte("test")})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment