Sayfa.DevServer.Rebuilder (Sayfa v0.5.0)

Copy Markdown View Source

GenServer that manages debounced site rebuilds.

Tracks a build_id counter that increments after each successful build. The dev server Plug polls this value for live reload detection.

Summary

Functions

Returns the current build ID (incremented after each successful build).

Returns a specification to start this module under a supervisor.

Starts the rebuilder.

Triggers a rebuild. Multiple calls within the debounce window are coalesced.

Functions

build_id()

@spec build_id() :: non_neg_integer()

Returns the current build ID (incremented after each successful build).

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the rebuilder.

Options

trigger_rebuild(reason \\ "file changed")

@spec trigger_rebuild(String.t()) :: :ok

Triggers a rebuild. Multiple calls within the debounce window are coalesced.