isaacfeliu-beanstalk-client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +45 -0
- data/License.txt +674 -0
- data/Manifest.txt +27 -0
- data/README.txt +1 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +72 -0
- data/config/requirements.rb +17 -0
- data/lib/beanstalk-client.rb +26 -0
- data/lib/beanstalk-client/connection.rb +393 -0
- data/lib/beanstalk-client/errors.rb +84 -0
- data/lib/beanstalk-client/job.rb +94 -0
- data/lib/beanstalk-client/version.rb +5 -0
- data/log/debug.log +0 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/test/test_beanstalk-client.rb +12 -0
- data/test/test_helper.rb +2 -0
- data/website/index.txt +79 -0
- metadata +80 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
desc 'Release the website and new gem version'
|
2
|
+
task :deploy => [:check_version, :website, :release] do
|
3
|
+
puts "Remember to create SVN tag:"
|
4
|
+
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
5
|
+
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
6
|
+
puts "Suggested comment:"
|
7
|
+
puts "Tagging release #{CHANGES}"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
11
|
+
task :local_deploy => [:website_generate, :install_gem]
|
12
|
+
|
13
|
+
task :check_version do
|
14
|
+
unless ENV['VERSION']
|
15
|
+
puts 'Must pass a VERSION=x.y.z release version'
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
unless ENV['VERSION'] == VERS
|
19
|
+
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
25
|
+
task :install_gem_no_doc => [:clean, :package] do
|
26
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :manifest do
|
30
|
+
desc 'Recreate Manifest.txt to include ALL files'
|
31
|
+
task :refresh do
|
32
|
+
`rake check_manifest | patch -p0 > Manifest.txt`
|
33
|
+
end
|
34
|
+
end
|
data/test/test_helper.rb
ADDED
data/website/index.txt
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
h1. Beanstalk Client
|
2
|
+
|
3
|
+
h1. → 'beanstalk-client'
|
4
|
+
|
5
|
+
|
6
|
+
h2. What
|
7
|
+
|
8
|
+
This is a Ruby client library for the Beanstalk protocol.
|
9
|
+
|
10
|
+
"<tt>beanstalkd</tt>":http://xph.us/software/beanstalkd/ is a fast,
|
11
|
+
distributed, in-memory work-queue service. Its interface is generic, but is
|
12
|
+
intended for use in reducing the latency of page views in high-volume web
|
13
|
+
applications by running most time-consuming tasks asynchronously.
|
14
|
+
|
15
|
+
h2. Installing
|
16
|
+
|
17
|
+
<p>First you must download and install the
|
18
|
+
"<tt>beanstalkd</tt>":http://xph.us/software/beanstalkd/ server.</p>
|
19
|
+
|
20
|
+
<p>Then just:</p>
|
21
|
+
|
22
|
+
<pre syntax="sh">sudo gem install beanstalk-client</pre>
|
23
|
+
|
24
|
+
<p>and you're ready to go!</p>
|
25
|
+
|
26
|
+
h2. How to use it
|
27
|
+
|
28
|
+
Here's an example of the low-level Ruby interface.
|
29
|
+
|
30
|
+
First, have one process put a job into the queue:
|
31
|
+
|
32
|
+
<pre syntax="ruby">
|
33
|
+
beanstalk = Beanstalk::Pool.new(['localhost:11300'])
|
34
|
+
...
|
35
|
+
beanstalk.put('hello')
|
36
|
+
</pre>
|
37
|
+
|
38
|
+
Then start another process to take jobs out of the queue and run them:
|
39
|
+
|
40
|
+
<pre syntax="ruby">
|
41
|
+
beanstalk = Beanstalk::Pool.new(['localhost:11300'])
|
42
|
+
loop do
|
43
|
+
job = beanstalk.reserve
|
44
|
+
puts job.body # prints "hello"
|
45
|
+
job.delete
|
46
|
+
end
|
47
|
+
</pre>
|
48
|
+
|
49
|
+
h2. Rails Integration
|
50
|
+
|
51
|
+
But you very likely want to use this in a Rails project. In that case, you
|
52
|
+
should check out the <a href=http://async-observer.rubyforge.org/>Async
|
53
|
+
Observer Rails plugin</a>. It gives far more functionality and a
|
54
|
+
super-easy-to-use interface.
|
55
|
+
|
56
|
+
h2. Forum
|
57
|
+
|
58
|
+
There's a google group called
|
59
|
+
"beanstalk-talk":http://groups.google.com/group/beanstalk-talk for all
|
60
|
+
discussion regarding <tt>beanstalkd</tt> and the various client libraries.
|
61
|
+
|
62
|
+
h2. How to submit patches
|
63
|
+
|
64
|
+
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
65
|
+
|
66
|
+
The repository is <code>http://xph.us/src/beanstalk-client-ruby.git</code> for anonymous access.
|
67
|
+
|
68
|
+
You can browse the repo at
|
69
|
+
"http://xph.us/git/beanstalk-client-ruby/":http://xph.us/git/beanstalk-client-ruby/.
|
70
|
+
|
71
|
+
h2. License
|
72
|
+
|
73
|
+
You can share this code under the terms of the GPL version 3.
|
74
|
+
|
75
|
+
h2. Contact
|
76
|
+
|
77
|
+
Comments are welcome. Send any questions or comments to the
|
78
|
+
"beanstalk-talk":http://groups.google.com/group/beanstalk-talk google group.
|
79
|
+
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: isaacfeliu-beanstalk-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Keith Rarick
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-05-01 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Ruby client library for the Beanstalk protocol
|
17
|
+
email: kr@causes.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- History.txt
|
24
|
+
- License.txt
|
25
|
+
- Manifest.txt
|
26
|
+
- README.txt
|
27
|
+
- website/index.txt
|
28
|
+
files:
|
29
|
+
- History.txt
|
30
|
+
- License.txt
|
31
|
+
- Manifest.txt
|
32
|
+
- README.txt
|
33
|
+
- Rakefile
|
34
|
+
- config/hoe.rb
|
35
|
+
- config/requirements.rb
|
36
|
+
- lib/beanstalk-client.rb
|
37
|
+
- lib/beanstalk-client/connection.rb
|
38
|
+
- lib/beanstalk-client/errors.rb
|
39
|
+
- lib/beanstalk-client/job.rb
|
40
|
+
- lib/beanstalk-client/version.rb
|
41
|
+
- log/debug.log
|
42
|
+
- script/destroy
|
43
|
+
- script/generate
|
44
|
+
- script/txt2html
|
45
|
+
- setup.rb
|
46
|
+
- tasks/deployment.rake
|
47
|
+
- tasks/environment.rake
|
48
|
+
- test/test_beanstalk-client.rb
|
49
|
+
- test/test_helper.rb
|
50
|
+
- website/index.txt
|
51
|
+
has_rdoc: true
|
52
|
+
homepage: http://beanstalk.rubyforge.org
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options:
|
55
|
+
- --main
|
56
|
+
- README.txt
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
rubyforge_project: beanstalk
|
74
|
+
rubygems_version: 1.0.1
|
75
|
+
signing_key:
|
76
|
+
specification_version: 2
|
77
|
+
summary: Ruby client library for the Beanstalk protocol
|
78
|
+
test_files:
|
79
|
+
- test/test_beanstalk-client.rb
|
80
|
+
- test/test_helper.rb
|