38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/jekyll/commands/serve/live_reload_reactor.rb', line 38
def start(opts)
@thread = Thread.new do
EM.epoll
EM.run do
EM.error_handler { |e| log_error(e) }
EM.start_server(
opts["host"],
opts["livereload_port"],
HttpAwareConnection,
opts
) do |ws|
handle_websockets_event(ws)
end
EM.schedule { @started_event.set }
EM.add_shutdown_hook { @stopped_event.set }
Jekyll.logger.info "LiveReload address:",
"http://#{opts["host"]}:#{opts["livereload_port"]}"
end
end
@thread.abort_on_exception = true
end
|