Skip to content

Commit c1f00f6

Browse files
committed
Replace in documentation deprecated timeout option with pool_timeout.
1 parent 05173dd commit c1f00f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ timeout for waiting for old connections to be released to the pool.
140140
To set up a pooled connection to a single MongoDB instance:
141141

142142
```ruby
143-
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :timeout => 5)
143+
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
144144
```
145145

146146
Though the pooling architecture will undoubtedly evolve, it currently owes much credit

lib/mongo/mongo_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class MongoClient
101101
# logging negatively impacts performance; therefore, it should not be used for high-performance apps.
102102
# @option opts [Integer] :pool_size (1) The maximum number of socket self.connections allowed per
103103
# connection pool. Note: this setting is relevant only for multi-threaded applications.
104-
# @option opts [Float] :timeout (5.0) When all of the self.connections a pool are checked out,
104+
# @option opts [Float] :pool_timeout (5.0) When all of the self.connections a pool are checked out,
105105
# this is the number of seconds to wait for a new connection to be released before throwing an exception.
106106
# Note: this setting is relevant only for multi-threaded applications.
107107
# @option opts [Float] :op_timeout (nil) The number of seconds to wait for a read operation to time out.
@@ -116,7 +116,7 @@ class MongoClient
116116
# MongoClient.new("localhost")
117117
#
118118
# @example localhost, 3000, max 5 self.connections, with max 5 seconds of wait time.
119-
# MongoClient.new("localhost", 3000, :pool_size => 5, :timeout => 5)
119+
# MongoClient.new("localhost", 3000, :pool_size => 5, :pool_timeout => 5)
120120
#
121121
# @example localhost, 3000, where this node may be a slave
122122
# MongoClient.new("localhost", 3000, :slave_ok => true)

0 commit comments

Comments
 (0)