lib/sensu/server/mutate.rb
# Execute a standard mutator (pipe), spawn a process using the
# mutator command and pipe the event data to it via STDIN. The
# `mutator_callback()` method is used to create the mutator
# callback, wrapping the provided callback (event handler).
#
# @param mutator [Hash] definition.
# @param event [Hash] data.
# @param callback [Proc] to call when the mutator executes
#   successfully.
Execute a standard mutator (pipe), spawn a process using the
mutator command and pipe the event data to it via STDIN. The
`mutator_callback()` method is used to create the mutator
callback, wrapping the provided callback (event handler).
Execute a standard mutator ( pipe ) spawn a process using the mutator command and pipe the event data to it via STDIN . The ` mutator_callback () ` method is used to create the mutator callback wrapping the provided callback ( event handler ) .
def pipe_mutator(mutator, event, &callback)
        options = {:data => Sensu::JSON.dump(event), :timeout => mutator[:timeout]}
        block = mutator_callback(mutator, event, &callback)
        Spawn.process(mutator[:command], options, &block)
      end
def pipe_mutator ( mutator , event , & callback ) options = { :data => Sensu :: JSON . dump ( event ) , :timeout => mutator [ :timeout ] } block = mutator_callback ( mutator , event , & callback ) Spawn . process ( mutator [ :command ] , options , & block ) end
Execute a standard mutator (pipe), spawn a process using the
mutator command and pipe the event data to it via STDIN.
Execute a standard mutator ( pipe ) spawn a process using the mutator command and pipe the event data to it via STDIN .
mutator
None
event
None
callback
to call when the mutator executes successfully.
to call when the mutator executes successfully .