Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): add subscription expiration policy docs #400

Merged
merged 2 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ export class PubSub {
* @property {boolean} [retainAckedMessages=false] If set, acked messages
* are retained in the subscription's backlog for the length of time
* specified by `options.messageRetentionDuration`.
* @property {ExpirationPolicy} [expirationPolicy] A policy that specifies
* the conditions for this subscription's expiration.
*/
/**
* Create a subscription to a topic.
Expand Down
20 changes: 20 additions & 0 deletions src/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ import {Subscriber} from './subscriber';
import {PubSub, Metadata} from '.';
import extend = require('extend');

/**
* @typedef {object} ExpirationPolicy
* A policy that specifies the conditions for this subscription's expiration. A
* subscription is considered active as long as any connected subscriber is
* successfully consuming messages from the subscription or is issuing
* operations on the subscription. If expirationPolicy is not set, a default
* policy with ttl of 31 days will be used. The minimum allowed value for
* expirationPolicy.ttl is 1 day. BETA: This feature is part of a beta release.
* This API might be changed in backward-incompatible ways and is not
* recommended for production use. It is not subject to any SLA or deprecation
* policy.
* @property {string} ttl Specifies the "time-to-live" duration for an associated
* resource. The resource expires if it is not active for a period of ttl. The
* eeedefinition of "activity" depends on the type of the associated resource.
* The minimum and maximum allowed values for ttl depend on the type of the
* associated resource, as well. If ttl is not set, the associated resource
* never expires. A duration in seconds with up to nine fractional digits,
* terminated by 's'. Example: "3.5s".
*/

/**
* @see https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions#PushConfig
*/
Expand Down