drive

fun drive(schedule: FlapSchedule): Job

Launch a FlapSchedule loop in scope and return the running Job.

Alternates SeamState.Woven (≈FlapSchedule.meanUptime) and SeamState.Weaving (≈FlapSchedule.meanDowntime) for FlapSchedule.giveUpAfter flaps, then tears. If FlapSchedule.giveUpAfter is 0, runs indefinitely until the seam is cancelled or tear is called externally.

All delays use kotlinx.coroutines.delay — virtual time under runTest.