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

Function ConsumerReplicas

js.go:2795–2803  ·  view source on GitHub ↗

ConsumerReplicas sets the number of replica count for a consumer.

(replicas int)

Source from the content-addressed store, hash-verified

2793
2794// ConsumerReplicas sets the number of replica count for a consumer.
2795func ConsumerReplicas(replicas int) SubOpt {
2796 return subOptFn(func(opts *subOpts) error {
2797 if replicas < 1 {
2798 return fmt.Errorf("invalid ConsumerReplicas value (%v), needs to be greater than 0", replicas)
2799 }
2800 opts.cfg.Replicas = replicas
2801 return nil
2802 })
2803}
2804
2805// ConsumerMemoryStorage sets the memory storage to true for a consumer.
2806func ConsumerMemoryStorage() SubOpt {

Callers

nothing calls this directly

Calls 2

subOptFnFuncType · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected