Releases: krzkaczor/effecton
Releases · krzkaczor/effecton
Release list
effecton@0.3.0
0.3.0
Minor Changes
- Launch the docs site: a landing page, an introduction, and a generated API Reference, with every Python snippet type-checked by ty at build time. (#26)
Patch Changes
- Add the E.HttpClient service: SyncLive and AsyncLive on httpx2, Test with canned responses or a handler, Request/Response values and filter_status_ok; HTTP client libraries are banned outside the service (#24)
- sleep, timeout and Schedule.spaced/exponential accept a duration as timedelta's keyword parts (seconds=5, minutes=1, ...) in place of a timedelta. (#26)
- Add the
E.Tracerservice:E.with_span(effect, name, kind=..., **attributes)opens a span around an effect (also aseffect.with_span),E.annotate_current_spanadds attributes,E.current_spanreads the open span,E.Tracer.Liveis the in-memory default,E.Tracer.Testrecords its spans, and thetest_tracerpytest fixture provides one (#25) - Add
effect.retry(schedule, until=...)withE.Schedule.recurs,E.Schedule.spaced, andE.Schedule.exponential(#19) - Effect.retry takes an optional schedule and a
timeskeyword, as in Effect-TS:retry(times=3)retries up to three times without waiting,retry(schedule, times=5)caps the schedule at five more recurrences, andretry()with neither recurs forever. (#26) - Add
schedule.jittered(min=0.8, max=1.2), which scales every delay by a factor drawn throughE.random(); schedule steps are now effects, so build a plain custom schedule withE.Schedule.from_delays(...)and an effectful one withE.Schedule(steps=...)(#22) - Add the
E.FileSystemservice (SyncLive,AsyncLiveon aiofiles, in-memoryTest) the immutableE.Path, and theE.Processservice (cwd,home); stdlib path and file APIs are banned outside the service (#23) on_exitalso accepts a function receiving the effect'sExitand returning the finalizer, so cleanup can depend on how the effect settled (#25)- Add the
E.Randomimplicit service:E.random()resolves it, its methods keep therandommodule names (random,uniform,randint,choice,shuffle),E.Random.Liveis the default,E.Random.Test(seed)is deterministic, and thetest_randompytest fixture provides one seeded with 0 (#22)
effecton@0.2.1
0.2.1
Patch Changes
- Ship a pytest plugin, registered through the pytest11 entry point so it loads wherever effecton is installed. A test that returns an Effect (typically an @E.gen function) runs under the async runner and a failure is reported as its cause. The test_clock fixture provides an E.Clock.Test to the test's effect. (#16)
- Add E.now() and E.sleep() backed by the implicit E.Clock service, with SyncLive, AsyncLive and Test clocks; each runner installs the matching live clock. (#16)
- Add
E.run_mainto execute sync and async programs with failure logging, defect tracebacks, custom exit codes, and graceful signal handling. (#14) - Add E.fork, E.Fiber (join, wait, poll, interrupt) and E.yield_now backed by asyncio tasks, and make the Test clock's adjust and set_time return effects. (#16)
- Add E.race_first(left, right) and E.timeout(duration) (#18)
effecton@0.2.0
0.2.0
Minor Changes
- Add
run_async,coroutineandattempt_asyncfor awaitable-backed effects (#12) - Split the runners:
run_syncandrun_asyncnow return the value and raise on failure (the error, the defect, orUnhandledDefectfor a non-exception defect);run_sync_exit,run_async_exitand the coroutinerun_async_coroutinereturn theExit(#13)
Patch Changes
effecton@0.1.1
0.1.1
Patch Changes
- Migrate from mypy to ty. Simplify api where possible.