Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support keepalive interval and retries.#944

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

PG-kura
Copy link

hello. I use tokio-postgres a lot.

Thing I want to do

I would like to customize interval and retries when keepalive is turned on.
Therefore, I propose to make it possible to specify the keepalive interval and retries in this pull-request.

Features to add

Previously, the only keepalive parameter waskeepalives_idle. This time, addkeepalives_interval andkeepalives_retries.keepalives_interval is available on neither Redox nor Solaris.keepalives_retries is available on neither Redox, Solaris nor Windows. This constraint aligns with that ofsocket2::TcpKeepalive.

Implementation

I thought that addingkeepalives_interval andkeepalives_retries blindly would increase the number of arguments for theconnect_socket::connect_socket() and make the source code messy.
So I defined a new structKeepaliveConfig. It does not publish outside the crate.
As an alternative, I considered puttingsocket2::TcpKeepalive inConfig, but I rejected it becausesocket2::TcpKeepalive has no getter method and is incompatible withConfig.

@sfackler
Copy link
Collaborator

Looks good to me other than the one comment!

@sfacklersfackler merged commit14e11bd intorust-postgres:masterAug 27, 2022
@sfackler
Copy link
Collaborator

Thanks!

@PG-kuraPG-kura deleted the support-keepalive-interval-and-retries branchAugust 27, 2022 16:23
@PG-kuraPG-kura restored the support-keepalive-interval-and-retries branchOctober 13, 2022 06:15
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sfacklersfacklersfackler left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@PG-kura@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp