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

Method Request

nats.go:4626–4628  ·  view source on GitHub ↗

Request will send a request payload and deliver the response message, or an error, including a timeout if no message was received properly.

(subj string, data []byte, timeout time.Duration)

Source from the content-addressed store, hash-verified

4624// Request will send a request payload and deliver the response message,
4625// or an error, including a timeout if no message was received properly.
4626func (nc *Conn) Request(subj string, data []byte, timeout time.Duration) (*Msg, error) {
4627 return nc.request(subj, nil, data, timeout)
4628}
4629
4630func (nc *Conn) useOldRequestStyle() bool {
4631 nc.mu.RLock()

Callers 15

ackReplyMethod · 0.45
ExampleConn_RequestFunction · 0.45
TestClosedConnectionsFunction · 0.45
TestEncBuiltinRequestFunction · 0.45
BenchmarkRequestFunction · 0.45
BenchmarkOldRequestFunction · 0.45
TestCustomInboxPrefixFunction · 0.45
TestRespInboxFunction · 0.45

Calls 1

requestMethod · 0.95

Tested by 15

ExampleConn_RequestFunction · 0.36
TestClosedConnectionsFunction · 0.36
TestEncBuiltinRequestFunction · 0.36
BenchmarkRequestFunction · 0.36
BenchmarkOldRequestFunction · 0.36
TestCustomInboxPrefixFunction · 0.36
TestRespInboxFunction · 0.36
TestEncProtoNilRequestFunction · 0.36