RequestMsgWithContext takes a context, a subject and payload in bytes and request expecting a single response.
(ctx context.Context, msg *Msg)
| 21 | // RequestMsgWithContext takes a context, a subject and payload |
| 22 | // in bytes and request expecting a single response. |
| 23 | func (nc *Conn) RequestMsgWithContext(ctx context.Context, msg *Msg) (*Msg, error) { |
| 24 | if msg == nil { |
| 25 | return nil, ErrInvalidMsg |
| 26 | } |
| 27 | hdr, err := msg.headerBytes() |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | return nc.requestWithContext(ctx, msg.Subject, hdr, msg.Data) |
| 32 | } |
| 33 | |
| 34 | // RequestWithContext takes a context, a subject and payload |
| 35 | // in bytes and request expecting a single response. |