Skip to content

Commit 7b8049d

Browse files
committed
docs: drive traffic light from action+sleep instead of DirectionalLight
The previous demo handed every workitem to a per-direction DirectionalLight GenServer that scheduled `Process.send_after/3` and called back into `WorkitemTransition.complete_workitem/2`. With PR #89 merged the runner's per-instance LifecycleHooks already give us a hook point for "after this transition fires" — we no longer need a separate GenServer holding timer state. This commit drops `TrafficLight.DirectionalLight` entirely. Each transition's `action do ... end` body now (a) re-renders the Kino frames from `event.markings`, (b) `:timer.sleep`s the colour-display delay, then (c) drives the next transition's workitem to completion via a small `TrafficLight.drive_next/2` helper. `on_enactment_start` bootstraps the cycle by driving `turn_green_ew`. The `TrafficLight.Supervisor` shrinks to a single child — the `Task.Supervisor` that wraps each action body — making the example roughly half the size while exercising more of the new DSL surface.
1 parent 85b344d commit 7b8049d

2 files changed

Lines changed: 311 additions & 627 deletions

File tree

0 commit comments

Comments
 (0)