-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection: support connection via an existing socket fd #349
Conversation
a858b07
to
4e6d41f
Compare
4e6d41f
to
ba56a18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watchers from the pool use conn.Addr() instead of id.
91146f5
to
41b0ee5
Compare
c846d06
to
acd3f18
Compare
a76f6d1
to
cd94a86
Compare
cd94a86
to
d185407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch! Please, squash two commits into one:
connection: make dialer mandatory
+
tests: correct according to the changes
Although correct the commit headers:
connection: make dialer mandatory
-> api: make dialer mandatory
dial: add the ability to connect via socket fd
-> api: add the ability to connect via socket fd
docs: update according to the changes
-> doc: update according to the changes
And move Closes https://github.com/tarantool/go-tarantool/issues/321
to a latest commit.
d185407
to
6010dd4
Compare
8ae96e7
to
b030c5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
Please, rebase the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thx for patch. Pls, rebase pull request.
b030c5f
to
159c916
Compare
701ba26
to
7ac35fa
Compare
This patch modifies `Connect` api. Now, to connect to the Tarantool, you need to pass an object that satisfies `tarantool.Dialer` interface. You can use one of the existing implementations: `NetDialer` or `OpenSslDialer`. For example: ``` conn, err := tarantool.Connect(context.Background(), tarantool.NetDialer{ Address: "127.0.0.1:3301", User: "user", Password: "secret", }, tarantool.Opts{}) ``` To create a connection pool, you need to pass a `map[string]tarantool.Dialer`, where each dialer is associated with a unique ID (for example, it can be the server address). Dialers will be distinguished from each other using these IDs. For example: ``` connPool, err := pool.Connect(context.Background(), map[string]tarantool.Dialer{ "127.0.0.1": tarantool.NetDialer{ Address: "127.0.0.1", User: "user", Password: "secret", }, }, tarantool.Opts{}) ``` The `conn.RemoteAddr` and `conn.LocalAddr` functions have been removed. To obtain the connection address, you can use `conn.Addr`. Now, `NewWatcher` checks the actual features of the server, rather than relying on the features provided by the user during connection creation. In the case of connection pool, watchers are created for connections that support this feature. `ClientProtocolInfo`, `ServerProtocolInfo` were removed. Now, there is `ProtocolInfo`, which returns the server protocol info. `pool.GetPoolInfo` was renamed to `pool.GetInfo`. Return type changed to `map[string]ConnectionInfo`. Part of #321
This patch introduces `FdDialer`, which connects to Tarantool using an existing socket file descriptor. `FdDialer` is not authenticated when creating a connection. Part of #321
7ac35fa
to
ba008c7
Compare
ba008c7
to
4cc6677
Compare
This patch contains several changes:
Now, to connect to the Tarantool, you need to pass an object that satisfies
tarantool.Dialer
interface.You can use one of the existing implementations:
NetDialer
,OpenSslDialer
orFdDialer
(which connects to the Tarantool using an existing socket fd).For example:
To create a connection pool, you need to pass a
map[string]tarantool.Dialer
,where each dialer is associated with a unique ID (for example, it can bethe server address). Connections will be distinguished from each other usingthese IDs.
For example:
The
conn.RemoteAddr
andconn.LocalAddr
functions have been removed. To obtain the connection address, you can useconn.Addr
.Now,
NewWatcher
checks the actual features of the server, rather than relyingon the features provided by the user during connection creation.
In the case of connection pool, watchers are created for connections that support
this feature.
ClientProtocolInfo
,ServerProtocolInfo
were removed. Now, there isProtocolInfo
,which returns the server protocol info.
I didn't forget about (remove if it is not applicable):
Related issues:
Closes #321