Class: Async::Container::Notify::Console

Inherits:
Client
  • Object
show all
Defined in:
lib/async/container/notify/console.rb

Overview

Implements a general process readiness protocol with output to the local console.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#ready!, #reloading!, #restarting!, #status!, #stopping!

Constructor Details

#initialize(logger) ⇒ Console

Initialize the notification client.



39
40
41
# File 'lib/async/container/notify/console.rb', line 39

def initialize(logger)
	@logger = logger
end

Class Method Details

.open!(logger = ::Console.logger) ⇒ Object

Open a notification client attached to the current console.



33
34
35
# File 'lib/async/container/notify/console.rb', line 33

def self.open!(logger = ::Console.logger)
	self.new(logger)
end

Instance Method Details

#error!(text, **message) ⇒ Object

Send an error message to the console.



51
52
53
# File 'lib/async/container/notify/console.rb', line 51

def error!(text, **message)
	send(status: text, level: :error, **message)
end

#send(level: :debug, **message) ⇒ Object

Send a message to the console.



44
45
46
# File 'lib/async/container/notify/console.rb', line 44

def send(level: :debug, **message)
	@logger.send(level, self) {message}
end