Skip to content

Fix GenServer.call/3 timeout doc: non-negative, not greater than zero#15568

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
nseaSeb:fix-genserver-call-timeout-doc
Jul 9, 2026
Merged

Fix GenServer.call/3 timeout doc: non-negative, not greater than zero#15568
josevalim merged 1 commit into
elixir-lang:mainfrom
nseaSeb:fix-genserver-call-timeout-doc

Conversation

@nseaSeb

@nseaSeb nseaSeb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The docs said timeout "is an integer greater than zero", but both the colocated guard (is_integer(timeout) and timeout >= 0) and the timeout typespec (:infinity | non_neg_integer()) accept 0GenServer.call(pid, msg, 0) is a legal call (time out immediately unless a reply is already waiting). The prose was the only place excluding zero; align it with the guard and the typespec.

Assisted-by: Claude Code:claude-opus-4-8

The docs said `timeout` "is an integer greater than zero", but both the
colocated guard (`is_integer(timeout) and timeout >= 0`) and the `timeout`
typespec (`:infinity | non_neg_integer()`) accept `0` — `GenServer.call(pid,
msg, 0)` is a legal call (time out immediately unless a reply is already
waiting). The prose was the only place excluding zero; align it with the
guard and the typespec.

Assisted-by: Claude Code:claude-opus-4-8
@josevalim
josevalim merged commit 345deb3 into elixir-lang:main Jul 9, 2026
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants