Project

jackal

0.0
No commit activity in last 3 years
No release in over 3 years
Message processing helper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

< 1.0.0, >= 0.1.24
~> 0.1
< 1.0.0, >= 0.1.12
< 2.0, >= 1.0.0
 Project Readme

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 provides subsystem configuration
    • require libraries to load at startup
  • fubar configuration of components (snake cased top level module)
    • helloer configuration of specific component (snake cased second level module)
      • sources configuration for carnivore sources
      • callbacks callback class names to initialize and attach to input source
      • config configuration hash used by callbacks

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