Package-level declarations

Types

Link copied to clipboard
interface HotReloadable<T>

Base interface for creating a hot-reloadable app. Note that these are required to be top-level classes as they are instantiated via reflection on hot-reload. Thus, they cannot require constructor parameters.

Link copied to clipboard
Link copied to clipboard

Hot reloading server. Watches for changes on the classpath source and rebuilds the project when changes are detected. Uses an event source connection script injected into the HTML pages to trigger a reload when the project is rebuilt.

Link copied to clipboard

Responsible for watching a set of paths for changes and acting on the changes.

Link copied to clipboard
fun interface ProjectCompiler

Represents the process to compile the project for hot reload.

Link copied to clipboard
class ProjectCompilingPathWatcher(projectCompiler: ProjectCompiler = Gradle(), watchedDirs: Set<String> = setOf("src/main", "src/test", "build/classes"), downtimeSleep: () -> Unit = { Thread.sleep(Duration.ofSeconds(1)) }) : PathWatcher

Watches for changes on the classpath source and rebuilds the project when changes are detected. If you have a project with a different structure, you can implement your own PathWatcher to pick up any custom paths to watch.

Link copied to clipboard
fun interface Reload<T>

Responsible for reloading an application when the classpath changes.

Link copied to clipboard
interface TaskRunner

Functions

Link copied to clipboard
fun HotReloadRoutes(app: HttpHandler, duration: Duration = ofMinutes(10), sleeper: (Duration) -> Unit = Thread::sleep): RoutingHttpHandler

Filter which injects a script into HTML responses using an event source to detect changes and reload the page.

Link copied to clipboard

Filter which injects a script into HTML responses using an event source to detect changes and reload the page.