MCPcopy
hub / github.com/nats-io/nats.go / RequestWithContext

Method RequestWithContext

context.go:36–38  ·  view source on GitHub ↗

RequestWithContext takes a context, a subject and payload in bytes and request expecting a single response.

(ctx context.Context, subj string, data []byte)

Source from the content-addressed store, hash-verified

34// RequestWithContext takes a context, a subject and payload
35// in bytes and request expecting a single response.
36func (nc *Conn) RequestWithContext(ctx context.Context, subj string, data []byte) (*Msg, error) {
37 return nc.requestWithContext(ctx, subj, nil, data)
38}
39
40func (nc *Conn) requestWithContext(ctx context.Context, subj string, hdr, data []byte) (*Msg, error) {
41 if ctx == nil {

Calls 1

requestWithContextMethod · 0.95