Run your carnivores.
{
"jackal": {
"require": [
"carnivore-http",
"fubar-helloer"
]
},
"fubar": {
"helloer": {
"sources": {
"input": {
...
},
"output": {
...
},
"error": {
...
}
},
"callbacks": [
"Fubar::Helloer::SayHello"
],
"config": {
"output_prefix": "Received message: "
}
}
}
}jackalprovides subsystem configurationrequirelibraries to load at startup
fubarconfiguration of components (snake cased top level module)helloerconfiguration of specific component (snake cased second level module)sourcesconfiguration for carnivore sourcescallbackscallback class names to initialize and attach to input sourceconfigconfiguration hash used by 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
endJackal provides test helpers building upon the helpers provided by Carnivore.
This executable will load minitest and auto run all files matched
by the glob: test/specs/*.rb.
- Repository: https://github.com/carnivore-rb/jackal
- Carnivore: https://github.com/carnivore-rb/carnivore
- IRC: Freenode @ #carnivore