cloudist 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/cloudist.gemspec +2 -2
- data/examples/sandwich_worker_with_class.rb +1 -1
- data/lib/cloudist.rb +9 -0
- data/lib/cloudist/queues/job_queue.rb +9 -0
- data/lib/cloudist/queues/reply_queue.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/cloudist.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cloudist}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ivan Vanderbyl"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-28}
|
13
13
|
s.description = %q{Cloudist is a simple, highly scalable job queue for Ruby applications, it can run within Rails, DaemonKit or your own custom application. Refer to github page for examples}
|
14
14
|
s.email = %q{ivanvanderbyl@me.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/cloudist.rb
CHANGED
@@ -34,6 +34,9 @@ module Cloudist
|
|
34
34
|
thread_local_accessor :listeners, :default => []
|
35
35
|
thread_local_accessor :listener_instances, :default => {}
|
36
36
|
|
37
|
+
thread_local_accessor :worker_prefetch, :default => 1
|
38
|
+
thread_local_accessor :listener_prefetch, :default => 1
|
39
|
+
|
37
40
|
# Start the Cloudist loop
|
38
41
|
#
|
39
42
|
# Cloudist.start {
|
@@ -53,6 +56,7 @@ module Cloudist
|
|
53
56
|
#
|
54
57
|
def start(options_or_connection = {}, &block)
|
55
58
|
if options_or_connection.is_a?(Hash)
|
59
|
+
extract_cloudist_options!(options_or_connection)
|
56
60
|
config = settings.update(options_or_connection)
|
57
61
|
AMQP.start(config) do
|
58
62
|
self.instance_eval(&block) if block_given?
|
@@ -63,6 +67,11 @@ module Cloudist
|
|
63
67
|
end
|
64
68
|
end
|
65
69
|
|
70
|
+
def extract_cloudist_options!(options)
|
71
|
+
self.worker_prefetch = options.delete(:worker_prefetch) || 1
|
72
|
+
self.listener_prefetch = options.delete(:listener_prefetch) || 1
|
73
|
+
end
|
74
|
+
|
66
75
|
def connection
|
67
76
|
AMQP.connection
|
68
77
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
module Cloudist
|
2
2
|
class JobQueue < Cloudist::Queues::BasicQueue
|
3
3
|
|
4
|
+
def initialize(queue_name, options={})
|
5
|
+
options[:auto_delete] = false
|
6
|
+
options[:nowait] = false
|
7
|
+
|
8
|
+
@prefetch = Cloudist.worker_prefetch
|
9
|
+
puts "Prefetch: #{@prefetch}"
|
10
|
+
super(queue_name, options)
|
11
|
+
end
|
12
|
+
|
4
13
|
# def initialize(queue_name, options={})
|
5
14
|
# @prefetch = 1
|
6
15
|
# # opts[:auto_delete] = false
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cloudist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ivan Vanderbyl
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-28 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -259,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
259
|
requirements:
|
260
260
|
- - ">="
|
261
261
|
- !ruby/object:Gem::Version
|
262
|
-
hash:
|
262
|
+
hash: 3218732857498604303
|
263
263
|
segments:
|
264
264
|
- 0
|
265
265
|
version: "0"
|