Run your carnivores.
{
"jackal": {
"require": [
"carnivore-http",
"fubar-helloer"
]
},
"fubar": {
"helloer": {
"sources": {
"input": {
...
},
"output": {
...
},
"error": {
...
}
},
"callbacks": [
"Fubar::Helloer::SayHello"
],
"config": {
"output_prefix": "Received message: "
}
}
}
}
jackal
provides subsystem configurationrequire
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 sourcescallbacks
callback class names to initialize and attach to input sourceconfig
configuration 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
end
Jackal 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