-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
pool: auto-close subscription after Duration
of no new events
#693
Conversation
94167e3
to
35d4c6f
Compare
@dluvian what do you think? Should the |
I like |
pub fn timeout(&self, timeout: Option<Duration>) -> Self { | ||
let mut builder = self.clone(); | ||
builder.inner = builder.inner.timeout(timeout); | ||
builder | ||
} | ||
|
||
/// Automatically close subscription if don't receive any more notifications/events within the duration. |
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.
/// Automatically close subscription if don't receive any more notifications/events within the duration. | |
/// Automatically close subscription if you don't receive any more notifications/events within the duration. |
/// Automatically close subscription if don't receive any more notifications/events within the duration. | |
/// Automatically close subscription if no notifications/events are received within the duration. |
@@ -171,6 +171,12 @@ impl JsSubscribeAutoCloseOptions { | |||
pub fn timeout(self, timeout: Option<JsDuration>) -> Self { | |||
self.inner.timeout(timeout.map(|t| *t)).into() | |||
} | |||
|
|||
/// Automatically close subscription if don't receive any more notifications/events within the duration. |
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.
/// Automatically close subscription if don't receive any more notifications/events within the duration. | |
/// Automatically close subscription if you don't receive any more notifications/events within the duration. |
/// Automatically close subscription if don't receive any more notifications/events within the duration. | |
/// Automatically close subscription if no notifications/events are received within the duration. |
pub fn timeout(mut self, timeout: Option<Duration>) -> Self { | ||
self.timeout = timeout; | ||
self | ||
} | ||
|
||
/// Automatically close subscription if don't receive any more notifications/events within the [`Duration`]. |
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.
/// Automatically close subscription if don't receive any more notifications/events within the [`Duration`]. | |
/// Automatically close subscription if you don't receive any more notifications/events within the [`Duration`]. |
/// Automatically close subscription if don't receive any more notifications/events within the [`Duration`]. | |
/// Automatically close subscription if no notifications/events are received within the [`Duration`]. |
Add `SubscribeAutoCloseOptions::relative_timeout` Closes #691 Co-authored-by: dluvian <dluvian@proton.me> Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
35d4c6f
to
60a10b1
Compare
No description provided.