MCPcopy Create free account
hub / github.com/google/go-cloud / NewSubscription

Function NewSubscription

pubsub/mempubsub/mem.go:249–251  ·  view source on GitHub ↗

NewSubscription creates a new subscription for the given topic. It panics if the given topic did not come from mempubsub. If a message is not acked within in the given ack deadline from when it is received, then it will be redelivered.

(pstopic *pubsub.Topic, ackDeadline time.Duration)

Source from the content-addressed store, hash-verified

247// If a message is not acked within in the given ack deadline from when
248// it is received, then it will be redelivered.
249func NewSubscription(pstopic *pubsub.Topic, ackDeadline time.Duration) *pubsub.Subscription {
250 return NewSubscriptionWithOptions(pstopic, ackDeadline, nil)
251}
252
253// NewSubscriptionWithOptions is similar to NewSubscription, but supports SubscriptionOptions.
254func NewSubscriptionWithOptions(pstopic *pubsub.Topic, ackDeadline time.Duration, opts *SubscriptionOptions) *pubsub.Subscription {

Callers 13

ExampleNewSubscriptionFunction · 0.92
TestSendReceiveFunction · 0.85
TestCancelReceiveFunction · 0.85
TestCancelTwoReceivesFunction · 0.85
TestRetryReceiveFunction · 0.85
TestBatchSizeDecaysFunction · 0.85
TestErrorsAreWrappedFunction · 0.85
TestOpenTelemetryFunction · 0.85
OpenSubscriptionURLMethod · 0.85

Calls 1

Tested by 12

ExampleNewSubscriptionFunction · 0.74
TestSendReceiveFunction · 0.68
TestCancelReceiveFunction · 0.68
TestCancelTwoReceivesFunction · 0.68
TestRetryReceiveFunction · 0.68
TestBatchSizeDecaysFunction · 0.68
TestErrorsAreWrappedFunction · 0.68
TestOpenTelemetryFunction · 0.68
BenchmarkMemPubSubFunction · 0.68