class OpalWebpackCompileServer::Exe
Public Class Methods
dont_unlink_on_exit()
click to toggle source
# File lib/opal-webpack-compile-server/exe.rb, line 119 def self.dont_unlink_on_exit @unlink = false end
run()
click to toggle source
# File lib/opal-webpack-compile-server/exe.rb, line 138 def self.run if File.exist?(OWCS_SOCKET_PATH) # OWCS already running puts 'Another Opal Webpack Compile Server already running, exiting' dont_unlink_on_exit exit(1) else unlink_on_exit load_paths = OpalWebpackCompileServer::LoadPathManager.get_load_paths if load_paths Opal.append_paths(*load_paths) Process.daemon(true) EventMachine.run do EventMachine.start_unix_domain_server(OWCS_SOCKET_PATH, OpalWebpackCompileServer::Compiler) end end end end
stop()
click to toggle source
# File lib/opal-webpack-compile-server/exe.rb, line 123 def self.stop if File.exist?(OWCS_SOCKET_PATH) dont_unlink_on_exit begin s = UNIXSocket.new(OWCS_SOCKET_PATH) s.send("command:stop\n", 0) s.close rescue # socket cant be reached so owcs is already dead, delete socket unlink_on_exit end exit(0) end end
unlink_on_exit()
click to toggle source
# File lib/opal-webpack-compile-server/exe.rb, line 115 def self.unlink_on_exit @unlink = true end
unlink_socket?()
click to toggle source
# File lib/opal-webpack-compile-server/exe.rb, line 111 def self.unlink_socket? @unlink end