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

Method wrapContextWithoutDeadline

jetstream/jetstream.go:1258–1263  ·  view source on GitHub ↗

wrapContextWithoutDeadline wraps context without deadline with default timeout. If deadline is already set, it will be returned as is, and cancel() will be nil. Caller should check if cancel() is nil before calling it.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1256// If deadline is already set, it will be returned as is, and cancel() will be nil.
1257// Caller should check if cancel() is nil before calling it.
1258func (js *jetStream) wrapContextWithoutDeadline(ctx context.Context) (context.Context, context.CancelFunc) {
1259 if _, ok := ctx.Deadline(); ok {
1260 return ctx, nil
1261 }
1262 return context.WithTimeout(ctx, js.opts.DefaultTimeout)
1263}
1264
1265// CleanupPublisher will cleanup the publishing side of JetStreamContext.
1266//

Callers 15

CreateStreamMethod · 0.95
UpdateStreamMethod · 0.95
StreamMethod · 0.95
DeleteStreamMethod · 0.95
AccountInfoMethod · 0.95
ListStreamsMethod · 0.95
StreamNamesMethod · 0.95
StreamNameBySubjectMethod · 0.95
PublishMsgMethod · 0.95
InfoMethod · 0.80
InfoMethod · 0.80
upsertConsumerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected