class

Kamil::Engine::LiveReloadHub

Inherits Reference < Object

[FUNC-005] [TECH-005] Browser Live-Reload Adapter Manages persistent Server-Sent Events (SSE) connections for browser live-reloading by delegating to the standalone Freshen::Hub shard.

Constructors

new(debounce_ms : Int32 = 50)
Source

Class methods

inject_script(html : String, require_body_tag : Bool = false, endpoint : String = "/dev/reload", script_id : String = "kamil-live-reload") : String

Injects the Live-Reload JavaScript snippet before </body> or appends it.

Source

Instance methods

broadcast_reload(*args, **options)
Source
broadcast_reload(*args, **options, &)
Source
client_count

Returns the count of registered active client connections.

Source
close(*args, **options)
Source
close(*args, **options, &)
Source
debounce_ms(*args, **options)
Source
debounce_ms(*args, **options, &)
Source
enqueue_change(*args, **options)
Source
enqueue_change(*args, **options, &)
Source
inject_script(html : String, require_body_tag : Bool = false, endpoint : String = "/dev/reload", script_id : String = "kamil-live-reload") : String

Instance method delegating to class script injector.

Source
register_client(client_id : String, stream : Kemal::EventStream) : Nil

Registers an active Kemal::EventStream SSE client stream.

Source
register_client(client_id : String, io : IO) : Nil

Registers an IO object as an SSE client stream.

Source
running?

Checks whether the live reload hub worker fiber is running.

Source
subscribe(io : IO) : String

Subscribes an IO object as an SSE client with an auto-generated identifier.

Source
trigger_reload(*args, **options)
Source
trigger_reload(*args, **options, &)
Source
unregister_client(*args, **options)
Source
unregister_client(*args, **options, &)
Source