Class: Google::Cloud::Spanner::Database::Job
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Database::Job
- Defined in:
- lib/google/cloud/spanner/database/job.rb
Overview
Job
A resource representing the long-running, asynchronous processing of a database create or update operation. The job can be refreshed to retrieve the database object once the operation has been completed.
See Project#create_database and #update.
Instance Method Summary collapse
-
#database ⇒ Google::Cloud::Spanner::Database?
The database that is the object of the operation.
-
#done? ⇒ boolean
Checks if the processing of the database operation is complete.
-
#error? ⇒ boolean
Checks if the processing of the database operation has errored.
-
#reload! ⇒ Google::Cloud::Spanner::Database::Job
(also: #refresh!)
Reloads the job with current data from the long-running, asynchronous processing of a database operation.
-
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete.
Instance Method Details
#database ⇒ Google::Cloud::Spanner::Database?
The database that is the object of the operation.
78 79 80 81 82 |
# File 'lib/google/cloud/spanner/database/job.rb', line 78 def database return nil unless done? return nil unless @grpc.grpc_op.result == :response Database.from_grpc @grpc.results, service end |
#done? ⇒ boolean
Checks if the processing of the database operation is complete.
99 100 101 |
# File 'lib/google/cloud/spanner/database/job.rb', line 99 def done? @grpc.done? end |
#error? ⇒ boolean
Checks if the processing of the database operation has errored.
118 119 120 |
# File 'lib/google/cloud/spanner/database/job.rb', line 118 def error? @grpc.error? end |
#reload! ⇒ Google::Cloud::Spanner::Database::Job Also known as: refresh!
Reloads the job with current data from the long-running, asynchronous processing of a database operation.
141 142 143 144 |
# File 'lib/google/cloud/spanner/database/job.rb', line 141 def reload! @grpc.reload! self end |
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete. The delay between reloads will incrementally increase.
163 164 165 |
# File 'lib/google/cloud/spanner/database/job.rb', line 163 def wait_until_done! @grpc.wait_until_done! end |