Flexweave
API Reference

Mechanics

Mechanics store registration and ticking.

Public exports:

  • MechanicsStore
  • MechanicsDriver
  • MechanicsTick

MechanicsDriver registers stores that can advance over clock units.

MechanicsStore<Event>

MechanicsStore is implemented by stores that can advance for one elapsed tick and emit lifecycle facts.

The built-in implementation covers EffectPipeline for:

  • EffectLifecycleEvent<Tags, Payload>
  • LocalLifecycleEvent<Tags, Payload>

MechanicsDriver

APIBehavior
newCreates an empty driver.
registerRegisters a store in tick order.
with_storeRegisters a store and returns the driver.

Stores tick in registration order.

MechanicsTick

MechanicsTick runs those stores in registration order and returns or streams emitted lifecycle facts.

APIBehavior
newCreates a tick from explicit elapsed units.
from_clockConverts a caller-owned clock step into elapsed units.
runAdvances stores and returns emitted facts in order.
run_streamingAdvances stores and streams emitted facts to a callback.

Use this when a runtime wants one tick command to advance multiple effect pipelines or mechanics stores.

Zero elapsed units emit no events.

Mechanics ticks do not project signals or publish channels automatically.

On this page