Module: Gapic::Rest::ResumableUpload

Defined in:
lib/gapic/rest/resumable_upload.rb,
lib/gapic/rest/resumable_upload/core.rb,
lib/gapic/rest/resumable_upload/rules.rb,
lib/gapic/rest/resumable_upload/driver.rb,
lib/gapic/rest/resumable_upload/errors.rb,
lib/gapic/rest/resumable_upload/events.rb,
lib/gapic/rest/resumable_upload/data_types.rb,
lib/gapic/rest/resumable_upload/instructions.rb,
lib/gapic/rest/resumable_upload/driver/abridge.rb,
lib/gapic/rest/resumable_upload/retry_policies.rb,
lib/gapic/rest/resumable_upload/driver/upload_log.rb,
lib/gapic/rest/resumable_upload/driver/retry_decider.rb

Overview

Resumable Upload Protocol implementation for REST transport: session initiation, chunked streaming, automatic retries, progress reporting via Progress, and resumption via ResumeHandle.

This namespace has no callable surface. Every method and class in it is internal machinery, documented as @private and excluded from these docs; what remains visible is the data a caller receives — Progress, ResumeHandle, HasResumeHandle — and the error classes listed below. Uploads are driven from Gapic::ResumableUpload, which sits above this namespace and coordinates runs against it.

Errors raised from here carry a ResumeHandle where the upload can still be continued, so the usual shape of handling one is to rescue HasResumeHandle and hand the handle back to the coordinator:

Error Types

Examples:

Uploading, then resuming after a recoverable failure

upload = client.upload_media ... # returns a Gapic::ResumableUpload
begin
  upload.start stream: File.open("movie.mp4", "rb"), upload_size: File.size("movie.mp4")
rescue Gapic::Rest::ResumableUpload::HasResumeHandle => e
  raise unless e.resume_handle
  upload.resume stream: File.open("movie.mp4", "rb"), resume_handle: e.resume_handle
end

Defined Under Namespace

Modules: HasResumeHandle Classes: BadResponseError, DeadlineExceededError, Progress, RequestFailedError, ResumeHandle, SessionStateError, StreamMismatchError, UnseekableStreamError, UploadCancelledError, UploadRejectedError