Skip to content

Commit

Permalink
fix(docs): add subscription expiration policy docs (#400)
Browse files Browse the repository at this point in the history
* fix(docs): add subscription expiration policy docs

* npm run fix
  • Loading branch information
jkwlui authored Dec 10, 2018
1 parent 7bdc190 commit ef2328b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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

0 comments on commit ef2328b

Please sign in to comment.