Module: Mongo::Retryable
- Extended by:
- Forwardable
- Included in:
- Cluster::CursorReaper, Collection, Collection::View::Aggregation, Collection::View::MapReduce, Cursor, Database, Database::View, Index::View, Server::Connection, Session
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/retryable.rb,
build/ruby-driver-v2.19/lib/mongo/retryable/base_worker.rb,
build/ruby-driver-v2.19/lib/mongo/retryable/read_worker.rb,
build/ruby-driver-v2.19/lib/mongo/retryable/write_worker.rb
Overview
Defines basic behavior around retrying operations.
Defined Under Namespace
Classes: BaseWorker, ReadWorker, WriteWorker
Instance Method Summary collapse
-
#read_worker ⇒ Object
private
Returns the read worker for handling retryable reads.
-
#select_server(cluster, server_selector, session) ⇒ Mongo::Server
private
This is a separate method to make it possible for the test suite to assert that server selection is performed during retry attempts.
-
#write_worker ⇒ Object
private
Returns the write worker for handling retryable writes.
Instance Method Details
#read_worker ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
this is only a public method so that tests can add expectations based on it.
Returns the read worker for handling retryable reads.
59 60 61 |
# File 'build/ruby-driver-v2.19/lib/mongo/retryable.rb', line 59 def read_worker @read_worker ||= ReadWorker.new(self) end |
#select_server(cluster, server_selector, session) ⇒ Mongo::Server
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This is a separate method to make it possible for the test suite to assert that server selection is performed during retry attempts.
This is a public method so that it can be accessed via the read and write worker delegates, as needed.
49 50 51 |
# File 'build/ruby-driver-v2.19/lib/mongo/retryable.rb', line 49 def select_server(cluster, server_selector, session) server_selector.select_server(cluster, nil, session) end |
#write_worker ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
this is only a public method so that tests can add expectations based on it.
Returns the write worker for handling retryable writes.
69 70 71 |
# File 'build/ruby-driver-v2.19/lib/mongo/retryable.rb', line 69 def write_worker @write_worker ||= WriteWorker.new(self) end |