Class: Fusuma::Plugin::Inputs::AppmatcherInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fusuma/plugin/inputs/appmatcher_input.rb

Overview

Get active application’s name

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



10
11
12
# File 'lib/fusuma/plugin/inputs/appmatcher_input.rb', line 10

def pid
  @pid
end

Instance Method Details

#ioObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fusuma/plugin/inputs/appmatcher_input.rb', line 12

def io
  @backend ||= Appmatcher.backend_klass.new

  @pid ||= begin
    pid = @backend.watch_start
    # NOTE: Closing the parent process's pipe
    @backend.writer.close

    pid
  end

  @backend.reader
end