Repository navigation
docs: correct stale Cachex API examples - #441
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
- decr/2 and decr/3 examples showed `:ok, N`; both return the integer
directly, matching incr/2 and the decr/4 example below them.
- export/2, inspect/2 and stream/3 showed :entry tuples in the old
{:entry, key, modified, expiration, value} order.
- stream/3 showed `true` for Cachex.put/4, which returns :ok.
- cache-routers.md typed children/2 as Supervisor.child_spec() rather
than [Supervisor.child_spec()].
- reactive-warming.md matched {:ok, nil} from Cachex.get/3, which
returns the value directly and nil on a miss.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct documentation examples that no longer match Cachex's existing return values and entry record order.
decrreturns the integer directly,getreturns the value or nil,putreturns:ok, entry tuples place value before timestamps, and routerchildren/2returns a list of child specs. No runtime code or behavior changes.Fixes #440. The proposal was raised there before this PR. This is the upstream submission of the unchanged documentation branch previously available in the fork.
Validation on Elixir 1.19.6: format, Credo, documentation generation, and overview drift checks passed. The complete suite contains 217 tests; two existing timestamp assertions with a 10 ms tolerance failed under machine load and passed when rerun. The documentation changes do not touch those assertions or runtime behavior. Current-head upstream CI remains pending.