Class: Google::Cloud::Pubsub::Snapshot
- Inherits:
- 
      Object
      
        - Object
- Google::Cloud::Pubsub::Snapshot
 
- Defined in:
- lib/google/cloud/pubsub/snapshot.rb,
 lib/google/cloud/pubsub/snapshot/list.rb
Overview
Snapshot
A named resource created from a subscription to retain a stream of messages from a topic. A snapshot is guaranteed to retain:
- The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
create_snapshotoperation; as well as:
- Any messages published to the subscription's topic following the
successful completion of the create_snapshotoperation.
Defined Under Namespace
Classes: List
Instance Method Summary collapse
- 
  
    
      #delete  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Removes an existing snapshot. 
- 
  
    
      #expiration_time  ⇒ Time 
    
    
  
  
  
  
  
  
  
  
  
    The snapshot is guaranteed to exist up until this time. 
- 
  
    
      #name  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    The name of the snapshot. 
- 
  
    
      #topic  ⇒ Topic 
    
    
  
  
  
  
  
  
  
  
  
    The Topic from which this snapshot is retaining messages. 
Instance Method Details
#delete ⇒ Boolean
Removes an existing snapshot. All messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.
| 131 132 133 134 135 | # File 'lib/google/cloud/pubsub/snapshot.rb', line 131 def delete ensure_service! service.delete_snapshot name true end | 
#expiration_time ⇒ Time
The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days.
| 109 110 111 | # File 'lib/google/cloud/pubsub/snapshot.rb', line 109 def expiration_time self.class. @grpc.expire_time end | 
#name ⇒ Object
The name of the snapshot. Format is
projects/{project}/snapshots/{snap}.
| 63 64 65 | # File 'lib/google/cloud/pubsub/snapshot.rb', line 63 def name @grpc.name end |