Skip to content
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

添加 Connect 方法, 支持创建一个单独的连接 #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hopehook
Copy link

No description provided.

@hopehook
Copy link
Author

从 Get 方法中把 Connect 拆出来,使得用户可以创建新的连接。
可能的应用场景:
1,Get 之后,发现连接池的连接失效,通过 Connect 重连进行操作,如果多次重试还是失效,说明 server 确实不可用。如果 server 只是短暂重启,Connect 可以支持这种场景,清理失效连接。

2,初始化的时候,连接池的数量设定的过少,希望后期人为增加连接数量。可以 Connect,然后 Put。

channel.go Outdated
}
}
}

//Conn 重新创建一个连接
Copy link
Owner

@silenceper silenceper Sep 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golint: Connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants