Skip to content

Commit f5f3e53

Browse files
committed
pool: add Instance type
The type Instance: ``` type Instance struct { Name string Dialer tarantool.Dialer Opts tarantool.Opts } ``` Allows to specify a dialer and connection options per a pool instance. It is used in `pool.Connect`, `pool.ConnectWithOpts` and `pool.Add` now to specify an instance configuration. Closes #356
1 parent d2c97bc commit f5f3e53

File tree

8 files changed

+350
-291
lines changed

8 files changed

+350
-291
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
6565
- Change `OverrideSchema(*Schema)` to `SetSchema(Schema)` (#7)
6666
- Change values, stored by pointers in the `Schema`, `Space`, `Index` structs,
6767
to be stored by their values (#7)
68-
- Make `Dialer` mandatory for creation a single connection / connection pool (#321)
68+
- Make `Dialer` mandatory for creation a single connection (#321)
6969
- Remove `Connection.RemoteAddr()`, `Connection.LocalAddr()`.
7070
Add `Addr()` function instead (#321)
7171
- Remove `Connection.ClientProtocolInfo`, `Connection.ServerProtocolInfo`.
@@ -93,6 +93,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
9393
`Call`, `Call16`, `Call17`, `Eval`, `Execute` of a `Connector` and `Pooler`
9494
return response data instead of an actual responses (#237)
9595
- Renamed `StrangerResponse` to `MockResponse` (#237)
96+
- `Pool.Add()` and `pool.Connect` use a new type `pool.Instance` to determinate
97+
connection options (#356)
9698

9799
### Deprecated
98100

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,19 @@ The subpackage has been deleted. You could use `pool` instead.
192192

193193
* The `connection_pool` subpackage has been renamed to `pool`.
194194
* The type `PoolOpts` has been renamed to `Opts`.
195-
* `pool.Connect` now accepts context as first argument, which user may cancel
196-
in process. If it is canceled in progress, an error will be returned.
195+
* `pool.Connect` now accepts context as the first argument, which user may
196+
cancel in process. If it is canceled in progress, an error will be returned.
197197
All created connections will be closed.
198-
* `pool.Add` now accepts context as first argument, which user may cancel in
199-
process.
200-
* Now you need to pass `map[string]Dialer` to the `pool.Connect` as the second
201-
argument, instead of a list of addresses. Each dialer is associated with a
202-
unique string ID, which allows them to be distinguished.
203-
* `pool.GetPoolInfo` has been renamed to `pool.GetInfo`. Return type has been changed
204-
to `map[string]ConnectionInfo`.
198+
* `pool.Connect` now accepts `[]pool.Instance` as the second argument instead
199+
of a list of addresses. Each instance is associated with a unique string
200+
name, `Dialer` and connection options which allows them to be independently
201+
configured.
202+
* `pool.Add` now accepts context as the first argument, which user may cancel
203+
in process.
204+
* `pool.Add` now accepts `pool.Instance` as the second argument instead of
205+
an address, it allows to configure a new instance more flexible.
206+
* `pool.GetPoolInfo` has been renamed to `pool.GetInfo`. Return type has been
207+
changed to `map[string]ConnectionInfo`.
205208
* Operations `Ping`, `Select`, `Insert`, `Replace`, `Delete`, `Update`, `Upsert`,
206209
`Call`, `Call16`, `Call17`, `Eval`, `Execute` of a `Pooler` return
207210
response data instead of an actual responses.

0 commit comments

Comments
 (0)