This changes HuginnScheduler and TwitterStream to use the new
AgentRunner
TwitterStream now uses the `twitter` gem to access the streaming API
which removes the `eventmachine` dependency (in production).
Make JabberAgent FormConfigurable and LongRunnable
Expect LongRunnable::Worker#run to be overridden
The threaded worker threw 'A copy of TwitterStream has been removed from
the module tree but is still active!' when running in development,
explicitly requiring 'twitter_stream' fixes that exception.
Before rufus would use 0.0 as the sleep interval if SCHEDULER_FREQUENCY
was not set which caused a significant amout of load due to rufus
running in a loop without sleeping at all
Graphviz is installed via heroku-buildpack-graphviz-src and the location
of dot(1) is automatically added to PATH.
There is also heroku-buildpack-graphviz-deb which should be easier to
install, but the Debian package installed has a font style problem.
Due to the three background workers (scheduler, twitter stream and delayed job)
huginn needs a lot of memory to run (about 520MB on my dev machine). This PR
introduces an optional threaded background worker which combines the three current
separated processed into one (reducing the memory footprint to ~260MB).
Since just one instance of the of every background processor is running at a time
there should not be any threading related issues.
The main gotcha of this is, that it's most likely not possible to run multiple
delayed job workers concurrently. The ultimate solution would probably be switching
to sidekiq with sidetiq as scheduler, but that is a different task :)
When running on MRI the GIL should not be an issue because it is released for most IO
bound operations (waiting for the database/website/sleeping).