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)
| 247 | // If a message is not acked within in the given ack deadline from when |
| 248 | // it is received, then it will be redelivered. |
| 249 | func 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. |
| 254 | func NewSubscriptionWithOptions(pstopic *pubsub.Topic, ackDeadline time.Duration, opts *SubscriptionOptions) *pubsub.Subscription { |