jonhoo / jonhoo/left-right

Can we wrap `wait` in publish under condition for first publish as it is no-op.

Open
#148 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

```
pub fn publish(&mut self) -> &mut Self {

+if !first {
self.wait(&mut epochs);
+}
self.update_and_swap(&mut epochs)
}
```
On first publish call, there are no readers on the w_handle, so we can just wrap that in `not of first`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the publish method shown in the issue and trace how the first publish call relates to wait, epochs, and update_and_swap. Verify that wait is skipped only for the first publish and remains active for later calls; done means the existing behavior is preserved while the first-call no-op is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.