natsio/request.go

16 lines
275 B
Go
Raw Normal View History

2021-12-02 03:08:44 +00:00
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)
}