Add client response

This commit is contained in:
Asim Aslam
2019-01-14 21:30:43 +00:00
parent f2ac73eae5
commit c1d0237370
8 changed files with 105 additions and 44 deletions

View File

@@ -11,12 +11,13 @@ import (
// Implements the streamer interface
type rpcStream struct {
sync.RWMutex
id string
closed chan bool
err error
request Request
codec codec.Codec
context context.Context
id string
closed chan bool
err error
request Request
response Response
codec codec.Codec
context context.Context
}
func (r *rpcStream) isClosed() bool {
@@ -36,6 +37,10 @@ func (r *rpcStream) Request() Request {
return r.request
}
func (r *rpcStream) Response() Response {
return r.response
}
func (r *rpcStream) Send(msg interface{}) error {
r.Lock()
defer r.Unlock()