diff options
Diffstat (limited to 'queue/set')
-rwxr-xr-x | queue/set/add.rb | 22 | ||||
-rwxr-xr-x | queue/set/run.rb | 32 |
2 files changed, 0 insertions, 54 deletions
diff --git a/queue/set/add.rb b/queue/set/add.rb deleted file mode 100755 index ab40607..0000000 --- a/queue/set/add.rb +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/ruby -# -# Add the same three tests over and over again. -# -# -require "redis" - -@redis = Redis.new(:host => "127.0.0.1") - - -x = [] - -x.push( "http://example.com/ must run http otherwise 'fail'" ) -x.push( "1.2.3.4 must run ping otherwise 'fail'" ) -x.push( "https://steve.net/ must run https otherwise 'fail'" ) - - -for i in 0 .. 10 - x.each do |test| - @redis.sadd('set', test) - end -end diff --git a/queue/set/run.rb b/queue/set/run.rb deleted file mode 100755 index f0b7476..0000000 --- a/queue/set/run.rb +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/ruby - -require "redis" -require 'pp' -@redis = Redis.new(:host => "127.0.0.1") - - - -def fetch(timeout = 1) - job = nil - - loop do - job = @redis.spop('set') - - if !job.nil? - return job - else - sleep(timeout) - end - - end -end - - - -while( x = fetch() ) - puts "Got job : #{x}" - if ( x =~ /ping/i ) - puts "PING TEST - sleeping" - sleep 5 - end -end |