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

Function getPushConsumer

jetstream/consumer.go:390–408  ·  view source on GitHub ↗
(ctx context.Context, js *jetStream, stream, name string)

Source from the content-addressed store, hash-verified

388}
389
390func getPushConsumer(ctx context.Context, js *jetStream, stream, name string) (PushConsumer, error) {
391 info, err := fetchConsumerInfo(ctx, js, stream, name)
392 if err != nil {
393 return nil, err
394 }
395
396 if info.Config.DeliverSubject == "" {
397 return nil, ErrNotPushConsumer
398 }
399
400 cons := &pushConsumer{
401 js: js,
402 stream: stream,
403 name: name,
404 info: info,
405 }
406
407 return cons, nil
408}
409
410func fetchConsumerInfo(ctx context.Context, js *jetStream, stream, name string) (*ConsumerInfo, error) {
411 ctx, cancel := js.wrapContextWithoutDeadline(ctx)

Callers 2

PushConsumerMethod · 0.85
PushConsumerMethod · 0.85

Calls 1

fetchConsumerInfoFunction · 0.85

Tested by

no test coverage detected