beanstalk-admin 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,4 +26,4 @@ rescue Exception => e
26
26
  end
27
27
  end
28
28
 
29
- puts "#{list.length} msgs loaded to queue: #{queueName}"
29
+ puts "#{list.length} msgs loaded to queue: #{queueName}"
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "beanstalk-client"
4
+
5
+ if ARGV.length == 1 then
6
+ queueName = ARGV[0]
7
+ else
8
+ abort( "Usage: beanstalk-admin-purge <queue name>" )
9
+ end
10
+
11
+
12
+ beanstalk = Beanstalk::Pool.new(['localhost:11300'])
13
+ begin
14
+ beanstalk.watch(queueName)
15
+ job = beanstalk.reserve 1
16
+
17
+ beanstalk.use(queueName)
18
+ beanstalk.put job.body
19
+
20
+ job.delete
21
+
22
+ rescue Exception => e
23
+ if e.message == "TIMED_OUT" then
24
+ puts "Timeout"
25
+ else
26
+ raise
27
+ end
28
+ end
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "beanstalk-client"
4
+
5
+ if ARGV.length == 1 then
6
+ queueName = ARGV[0]
7
+ else
8
+ abort( "Usage: beanstalk-admin-purge <queue name>" )
9
+ end
10
+
11
+
12
+ beanstalk = Beanstalk::Pool.new(['localhost:11300'])
13
+ begin
14
+ beanstalk.watch(queueName)
15
+ job = beanstalk.reserve 1
16
+ job.delete
17
+
18
+ rescue Exception => e
19
+ if e.message == "TIMED_OUT" then
20
+ puts "Timeout"
21
+ else
22
+ raise
23
+ end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalk-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-20 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A number of administration tools for working with beanstalk tubes
15
15
  email: guy@guyirvine.com
@@ -19,13 +19,17 @@ executables:
19
19
  - beanstalk-admin-purge
20
20
  - beanstalk-admin-dump
21
21
  - beanstalk-admin-load
22
+ - beanstalk-admin-movetoback
23
+ - beanstalk-admin-pop
22
24
  extensions: []
23
25
  extra_rdoc_files: []
24
26
  files:
25
27
  - bin/beanstalk-admin-dump
26
28
  - bin/beanstalk-admin-list
27
29
  - bin/beanstalk-admin-load
30
+ - bin/beanstalk-admin-movetoback
28
31
  - bin/beanstalk-admin-peek
32
+ - bin/beanstalk-admin-pop
29
33
  - bin/beanstalk-admin-purge
30
34
  - bin/Gemfile
31
35
  - README.md