add request method
This commit is contained in:
parent
7c944a9897
commit
6664e4ef98
|
@ -0,0 +1,15 @@
|
|||
package natsio
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
// Default timeout 10s
|
||||
const requestTimeout = 10 * time.Second
|
||||
|
||||
// Request ...
|
||||
func Request(subject string, payload []byte) (*nats.Msg, error) {
|
||||
return natsClient.Request(subject, payload, requestTimeout)
|
||||
}
|
Loading…
Reference in New Issue