Class: Edaemon::Server
- Inherits:
-
Object
- Object
- Edaemon::Server
- Defined in:
- lib/edaemon/server.rb
Constant Summary collapse
- PID_FILE_PATH =
'./edaemon.pid'- LOG_FILE_PATH =
'./edaemon.log'- Error =
Class.new(StandardError)
- ApplicationAllreadyRunnedError =
Class.new(Error)
Instance Method Summary collapse
-
#initialize(block:) ⇒ Server
constructor
A new instance of Server.
-
#start ⇒ Object
TODO: Конфиг лога TODO: Конфиг пид файла.
Constructor Details
#initialize(block:) ⇒ Server
Returns a new instance of Server.
10 11 12 |
# File 'lib/edaemon/server.rb', line 10 def initialize(block:) @block = block end |
Instance Method Details
#start ⇒ Object
TODO: Конфиг лога TODO: Конфиг пид файла
16 17 18 19 20 21 22 23 |
# File 'lib/edaemon/server.rb', line 16 def start # TODO: simplecov raise почему не подсвечивается raise ApplicationAllreadyRunnedError if pid_runned?(pid: saved_pid) pid = fork_block! save_pid!(pid: pid) pid end |