Skip to content

domain safety for log, rate limiter, parts of cache - #71

Merged
c-cube merged 5 commits into
masterfrom
sc/some-domain-safety
Oct 6, 2026
Merged

c-cube merged 5 commits into
masterfrom
sc/some-domain-safety

Conversation

@c-cube

@c-cube c-cube commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@c-cube
c-cube added this pull request to stack #73 October 1, 2026 15:18
@c-cube
c-cube marked this pull request as ready for review October 1, 2026 19:46
Comment thread control.ml
Comment on lines +32 to +41
type bucket = {
tokens: float;
last_update: float;
}

type t =
| Unlimited
| RL of {
mutable tokens: float;
mutable count_silenced: int;
mutable last_update: float;
bucket: bucket Atomic.t; (** current state. avoid mutex for reentrancy *)
count_silenced: int Atomic.t;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ping @davesnx this is potentially a good motivating example for nested record types:

  • need to introduce a new type just to group the atomicity together
  • new type isn't necessarily semantically meaningful, just "need to update together" is why it's introduced

@raphael-proust raphael-proust left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread control.ml Outdated
@c-cube
c-cube merged commit 43e622b into master Oct 6, 2026
2 checks passed
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.

2 participants