rock-queue-smpp 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/{rock-queue → rock-queue-smpp}/active_record_helper.rb +3 -3
- data/lib/{rock-queue → rock-queue-smpp}/adapters/beanstalkd.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/adapters/delayed_job.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/adapters/resque.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/config.rb +2 -2
- data/lib/{rock-queue → rock-queue-smpp}/errors.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/notifiers/email_notifier.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/notifiers.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/queue_object.rb +2 -2
- data/lib/{rock-queue → rock-queue-smpp}/tasks.rb +1 -1
- data/lib/rock-queue-smpp/web/views/dashboard.erb +1 -0
- data/lib/{rock-queue → rock-queue-smpp}/web.rb +1 -1
- data/lib/{rock-queue → rock-queue-smpp}/worker.rb +4 -4
- data/lib/{rock-queue.rb → rock-queue-smpp.rb} +1 -1
- metadata +18 -18
- data/lib/rock-queue/web/views/dashboard.erb +0 -1
- /data/lib/{rock-queue → rock-queue-smpp}/notifiers/abstract_notifier.rb +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'active_record'
|
2
2
|
|
3
|
-
module
|
3
|
+
module RockQueueSmpp
|
4
4
|
module ActiveRecordHelper
|
5
5
|
def self.included(base)
|
6
6
|
base.extend ClassMethods
|
@@ -18,8 +18,8 @@ module RockQueue
|
|
18
18
|
|
19
19
|
module InstanceMethods
|
20
20
|
def async(method, *args)
|
21
|
-
config =
|
22
|
-
rq =
|
21
|
+
config = RockQueueSmpp::Config.settings
|
22
|
+
rq = RockQueueSmpp::Base.new config.adapter, {:server => config.host, :port => config.port}
|
23
23
|
rq.push self.class, id, method, *args
|
24
24
|
end
|
25
25
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module RockQueueSmpp
|
2
2
|
class Config
|
3
3
|
|
4
4
|
attr_accessor :adapter, :host, :port, :smpp_config
|
@@ -8,7 +8,7 @@ module RockQueue
|
|
8
8
|
@__instance__ ||= new
|
9
9
|
end
|
10
10
|
|
11
|
-
# Yields a singleton instance of
|
11
|
+
# Yields a singleton instance of RockQueueSmpp::Config so you can specify config
|
12
12
|
# information like server address, port etc.
|
13
13
|
def self.settings
|
14
14
|
if block_given?
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module RockQueueSmpp
|
2
2
|
|
3
3
|
# Queue object wrapper
|
4
4
|
class QueueObject
|
@@ -20,7 +20,7 @@ module RockQueue
|
|
20
20
|
if @fails.length < DEFAULT_FAIL_LIMIT
|
21
21
|
return true
|
22
22
|
else
|
23
|
-
|
23
|
+
RockQueueSmpp::Notifiers.instance.notify(exception)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -3,7 +3,7 @@ require 'rock-queue'
|
|
3
3
|
namespace :rock_queue do
|
4
4
|
desc "Start a Rock Queue worker"
|
5
5
|
task :work do
|
6
|
-
worker =
|
6
|
+
worker = RockQueueSmpp::Worker.new
|
7
7
|
worker.verbose = ENV['VERBOSE']
|
8
8
|
puts "=> Rock-queue worker initialized (#{worker})"
|
9
9
|
worker.work
|
@@ -0,0 +1 @@
|
|
1
|
+
RockQueueSmpp Web Interface
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module RockQueueSmpp
|
2
2
|
class Worker
|
3
3
|
# Whether the worker should log basic info to STDOUT
|
4
4
|
attr_accessor :verbose
|
@@ -6,8 +6,8 @@ module RockQueue
|
|
6
6
|
# Initialize connection to queue server
|
7
7
|
def initialize
|
8
8
|
puts "=> Initializing..."
|
9
|
-
config =
|
10
|
-
@queue =
|
9
|
+
config = RockQueueSmpp::Config.settings
|
10
|
+
@queue = RockQueueSmpp::Base.new config.adapter, {
|
11
11
|
:server => config.host,
|
12
12
|
:port => config.port
|
13
13
|
}
|
@@ -16,7 +16,7 @@ module RockQueue
|
|
16
16
|
# Main worker loop where all jobs are beeing pulled of the queue.
|
17
17
|
# This is also a place where every job starts and ends it's lifecycle.
|
18
18
|
def work
|
19
|
-
config =
|
19
|
+
config = RockQueueSmpp::Config.settings
|
20
20
|
puts "=> Worker ready. Hold your horses!"
|
21
21
|
loop do
|
22
22
|
EventMachine::run do
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rock-queue-smpp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Kazulak, Matt Van Veenendaal
|
8
|
-
autorequire: rock-queue
|
8
|
+
autorequire: rock-queue-smpp
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
@@ -24,23 +24,23 @@ extra_rdoc_files:
|
|
24
24
|
files:
|
25
25
|
- LICENSE
|
26
26
|
- Rakefile
|
27
|
-
- lib/rock-queue/active_record_helper.rb
|
28
|
-
- lib/rock-queue/adapters/beanstalkd.rb
|
29
|
-
- lib/rock-queue/adapters/delayed_job.rb
|
30
|
-
- lib/rock-queue/adapters/resque.rb
|
31
|
-
- lib/rock-queue/config.rb
|
32
|
-
- lib/rock-queue/errors.rb
|
33
|
-
- lib/rock-queue/notifiers/abstract_notifier.rb
|
34
|
-
- lib/rock-queue/notifiers/email_notifier.rb
|
35
|
-
- lib/rock-queue/notifiers.rb
|
36
|
-
- lib/rock-queue/queue_object.rb
|
37
|
-
- lib/rock-queue/tasks.rb
|
38
|
-
- lib/rock-queue/web/views/dashboard.erb
|
39
|
-
- lib/rock-queue/web.rb
|
40
|
-
- lib/rock-queue/worker.rb
|
41
|
-
- lib/rock-queue.rb
|
27
|
+
- lib/rock-queue-smpp/active_record_helper.rb
|
28
|
+
- lib/rock-queue-smpp/adapters/beanstalkd.rb
|
29
|
+
- lib/rock-queue-smpp/adapters/delayed_job.rb
|
30
|
+
- lib/rock-queue-smpp/adapters/resque.rb
|
31
|
+
- lib/rock-queue-smpp/config.rb
|
32
|
+
- lib/rock-queue-smpp/errors.rb
|
33
|
+
- lib/rock-queue-smpp/notifiers/abstract_notifier.rb
|
34
|
+
- lib/rock-queue-smpp/notifiers/email_notifier.rb
|
35
|
+
- lib/rock-queue-smpp/notifiers.rb
|
36
|
+
- lib/rock-queue-smpp/queue_object.rb
|
37
|
+
- lib/rock-queue-smpp/tasks.rb
|
38
|
+
- lib/rock-queue-smpp/web/views/dashboard.erb
|
39
|
+
- lib/rock-queue-smpp/web.rb
|
40
|
+
- lib/rock-queue-smpp/worker.rb
|
41
|
+
- lib/rock-queue-smpp.rb
|
42
42
|
has_rdoc: true
|
43
|
-
homepage: http://github.com/mattvv/rock-queue-
|
43
|
+
homepage: http://github.com/mattvv/rock-queue-smpp
|
44
44
|
licenses: []
|
45
45
|
|
46
46
|
post_install_message:
|
@@ -1 +0,0 @@
|
|
1
|
-
RockQueue Web Interface
|
File without changes
|