Skip to content

Commit 524ec56

Browse files
committed
persist: add note on heartbeat-ing to rustdoc
It was pointed out in the design doc review that this info was stale.
1 parent 081f04a commit 524ec56

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/persist-client/src/read.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ where
352352
/// system. A `new_since` of the empty antichain "finishes" this shard,
353353
/// promising that no more data will ever be read by this handle.
354354
///
355+
/// It is possible to heartbeat a reader lease by calling this with
356+
/// `new_since` equal to `self.since()` (making the call a no-op).
357+
///
355358
/// The clunky two-level Result is to enable more obvious error handling in
356359
/// the caller. See <http://sled.rs/errors.html> for details.
357360
pub async fn downgrade_since(

src/persist-client/src/write.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ where
9999
/// incoming.
100100
///
101101
/// `updates` may be empty, which allows for downgrading `upper` to
102-
/// communicate progress. It is unexpected to call this with `new_upper`
103-
/// equal to `self.upper()`, as it would mean `updates` must be empty
104-
/// (making the entire call a no-op).
102+
/// communicate progress. It is possible to heartbeat a writer lease by
103+
/// calling this with `new_upper` equal to `self.upper()` and an empty
104+
/// `updates` (making the call a no-op).
105105
///
106106
/// This uses a bounded amount of memory, even when `updates` is very large.
107107
/// Individual records, however, should be small enough that we can
@@ -157,7 +157,8 @@ where
157157
}
158158

159159
/// Applies `updates` to this shard and downgrades this handle's upper to
160-
/// `new_upper` iff the current global upper of this shard is `expected_upper`.
160+
/// `new_upper` iff the current global upper of this shard is
161+
/// `expected_upper`.
161162
///
162163
/// The innermost `Result` is `Ok` if the updates were successfully written.
163164
/// If not, an `Err` containing the current global upper is returned.
@@ -172,9 +173,9 @@ where
172173
/// incoming.
173174
///
174175
/// `updates` may be empty, which allows for downgrading `upper` to
175-
/// communicate progress. It is unexpected to call this with `new_upper`
176-
/// equal to `self.upper()`, as it would mean `updates` must be empty
177-
/// (making the entire call a no-op).
176+
/// communicate progress. It is possible to heartbeat a writer lease by
177+
/// calling this with `new_upper` equal to `self.upper()` and an empty
178+
/// `updates` (making the call a no-op).
178179
///
179180
/// This uses a bounded amount of memory, even when `updates` is very large.
180181
/// Individual records, however, should be small enough that we can

0 commit comments

Comments
 (0)