System timer warning #22

Closed
wants to merge 4 commits into from

2 participants

@netshade

Warn users about system_timer when not installed, fallback to timeout

@jqr jqr commented on an outdated diff Feb 28, 2012
lib/instrumental/agent.rb
@@ -4,9 +4,25 @@
require 'thread'
require 'socket'
if RUBY_VERSION < "1.9"
- require 'system_timer'
+ begin
+ gem 'system_timer'
+ require 'system_timer'
+ InstrumentalTimeout = SystemTimer
+ rescue Exception => e
+ puts <<-EOMSG
+WARNING:: You do not currently have system_timer installed.
+It is strongly advised that you install this gem when using
+instrumental_agent. You can install it in your Gemfile via:
@jqr
instrumental member
jqr added a note Feb 28, 2012

How about "when using instrumental_agent with Ruby 1.8.x"

Also, only warn on that condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jqr
instrumental member

Otherwise 👍

@netshade netshade closed this Mar 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment