You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-18Lines changed: 14 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,16 +38,15 @@ connection pool and a raw client.
38
38
$redis.then { |r| r.set 'foo''bar' }
39
39
```
40
40
41
-
Optionally, you can specify a timeout override using the with-block semantics:
41
+
Optionally, you can specify a timeout override:
42
42
43
43
```ruby
44
44
$memcached.with(timeout:2.0) do |conn|
45
45
conn.get('some-count')
46
46
end
47
47
```
48
48
49
-
This will only modify the resource-get timeout for this particular
50
-
invocation.
49
+
This will only modify the timeout for this particular invocation.
51
50
This is useful if you want to fail-fast on certain non-critical
52
51
sections when a resource is not available, or conversely if you are comfortable blocking longer on a particular resource.
53
52
@@ -71,7 +70,7 @@ $redis.with do |conn|
71
70
end
72
71
```
73
72
74
-
Once you've ported your entire system to use `with`, you can simply remove `Wrapper` and use the simpler and faster `ConnectionPool`.
73
+
Once you've ported your entire system to use `with`, you can remove `::Wrapper` and use `ConnectionPool` directly.
75
74
76
75
77
76
## Shutdown
@@ -89,16 +88,17 @@ Shutting down a connection pool will block until all connections are checked in
89
88
90
89
## Reload
91
90
92
-
You can reload a ConnectionPool instance in the case it is desired to close all connections to the pool and, unlike `shutdown`, afterwards recreate connections so the pool may continue to be used.
93
-
Reloading may be useful after forking the process.
91
+
You can reload a ConnectionPool instance if it is necessary to close all existing connections and continue to use the pool.
92
+
ConnectionPool will automatically reload if the process is forked.
93
+
Use `auto_reload_after_fork: false` if you don't want this behavior.
0 commit comments