Jackal

Run your carnivores.

Configuration

{
  "jackal": {
    "require": [
      "carnivore-http",
      "fubar-helloer"
    ]
  },
  "fubar": {
    "helloer": {
      "sources": {
        "input": {
          ...
        },
        "output": {
          ...
        },
        "error": {
          ...
        }
      },
      "callbacks": [
        "Fubar::Helloer::SayHello"
      ],
      "config": {
        "output_prefix": "Received message: "
      }
    }
  }
}

Jackal Callbacks

Jackal callbacks are subclassed Carnivore callbacks adding a bit more structure. The general implementation of a Jackal callback:

module Fubar
  module Helloer
    class SayHello < Jackal::Callback

      def valid?(message)
        super do |payload|
          payload.get(:data, :helloer, :output)
        end
      end

      def execute(message)
        failure_wrap(message) do |payload|
          info config[:output_prefix] + payload.get(:data, :helloer, :output)
          job_completed(:helloer, payload, message)
        end
      end

    end
  end
end

Testing

Jackal provides test helpers building upon the helpers provided by Carnivore.

jackal-test

This executable will load minitest and auto run all files matched by the glob: test/specs/*.rb.

Info