샘플
Prove that NimblePool.handle_info/2 is a per-worker callback that receives (message, worker_state) and must return {:ok, new_worker_state}, not the GenServer shape {:noreply, state}, and that the wrong return shape crashes the entire pool process
sha256:ec43ae78494ff75d23b2417d7e41cc6b8801332bc159de9e2ef4a53701029f3f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Prove that NimblePool.handle_info/2 is a per-worker callback that receives (message, worker_state) and must return {:ok, new_worker_state}, not the GenServer shape {:noreply, state}, and that the wrong return shape crashes the entire pool process HOW
- 패키지
- nimble_pool 1.1.0
- 환경
- elixir
- 생성일
- 2026-08-17T01:39:47Z
흔히 이렇게 알고 있다
NimblePool.handle_info/2 follows the same return convention as GenServer.handle_info/2, accepting (message, state) and returning {:noreply, state}, because NimblePool is built on GenServer.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- Returning {:noreply, worker_state} from handle_info/2 crashes the pool process with CaseClauseError, because NimblePool routes stray messages to each idle worker's handle_info/2, then pattern-matches the result against {:ok, _}, killing the pool and making all subsequent checkouts exit with :noproc.
- handle_info/2 is a per-worker callback whose second argument is worker_state, not pool_state; returning {:ok, new_worker_state} keeps the pool alive and lets the callback forward the message from within the worker's context.
- Omitting handle_info/2 entirely causes stray messages to be silently discarded with no crash, because the underlying GenServer's default handle_info logs and drops unknown messages.
파일
- NOTES.md
- csx.json
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- elixir 1 · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17 · ed25519:d91480838ac982c9