Class: PostfixDaemon
- Inherits:
-
Object
- Object
- PostfixDaemon
- Defined in:
- lib/postfix_daemon.rb,
lib/postfix_daemon/version.rb
Overview
Postfix daemon program
Constant Summary collapse
- DEFAULT_MAX_IDLE =
100- DEFAULT_MAX_USE =
100- MASTER_STATUS_FD =
5- MASTER_LISTEN_FD =
6- VERSION =
"0.1.0"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args, setup: nil, service: nil) ⇒ PostfixDaemon
constructor
A new instance of PostfixDaemon.
- #run {|socket, addr| ... } ⇒ Object
Constructor Details
#initialize(args, setup: nil, service: nil) ⇒ PostfixDaemon
Returns a new instance of PostfixDaemon.
26 27 28 29 30 31 32 33 |
# File 'lib/postfix_daemon.rb', line 26 def initialize(args, setup: nil, service: nil) @args = args.dup @setup = setup @service = service @nsocks = nil @max_idle = nil @max_use = nil end |
Class Method Details
.start(args = ARGV) {|socket, addr| ... } ⇒ Object
19 20 21 |
# File 'lib/postfix_daemon.rb', line 19 def self.start(args=ARGV, &block) self.new(args).run(&block) end |
Instance Method Details
#run {|socket, addr| ... } ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/postfix_daemon.rb', line 38 def run(&block) parse_args setup @setup.call if @setup @service = block if block raise 'block required' unless @service main end |