Repository navigation
Agent usage rules in the package, a leaner telemetry payload, a Troubleshooting guide, and CI through Elixir 1.20.
Added
-
usage-rules.md, shipped in the package — WaitForIt's guidance condensed for AI coding agents, in the layoutusage_rulessyncs from. Pull it into yourAGENTS.mdwithmix usage_rules.sync, or read it atdeps/wait_for_it/usage-rules.md.It leads with the one rule — on timeout each form behaves as its native counterpart would on a final non-matching evaluation — then the traps that are silent when you get them wrong: a catch-all clause in
case_wait/cond_waitdisables the waiting entirely (measured: it halts after one evaluation in 4 ms), waiting blocks the calling process and must not happen inside a GenServer callback, signals are node-local, andtimeout: :infinityremoves all timeout behaviour rather than merely extending it. -
Elixir 1.19 and 1.20 in the CI matrix, which now spans the declared floor (
~> 1.15) through the current release. (#23) -
A Troubleshooting guide, opening with "Why does the compiler say my pattern will never match?" (#24)
Changed
-
Telemetry metadata
envis now a trimmed map rather than the caller's wholeMacro.Env(#22). It carries exactly:context,:context_modules,:file,:function,:lineand:module— the same six fieldsWaitForIt.TimeoutErrorhas always exposed.A full
__ENV__measured 1019 words (~8 KB), most of it the calling module's import table, embedded in the compiled module once per wait and copied again by every handler forwarding metadata off-process. The trim happens at macro expansion, so the fat term is never emitted:before after envterm1019 words 29 words whole event metadata 1039 words 49 words caller's compiled beam 12,612 bytes 3,360 bytes Upgrading: a handler reading anything outside those six keys needs updating; one reading
env.fileorenv.linedoes not.
Installation
{:wait_for_it, "~> 2.5"}