run_rabbit_run 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/run_rabbit_run/rabbitmq.rb +2 -2
- data/lib/run_rabbit_run/tasks.rb +14 -0
- data/lib/run_rabbit_run/version.rb +1 -1
- metadata +3 -3
@@ -29,7 +29,7 @@ module RunRabbitRun
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def publish(queue, data)
|
32
|
-
exchange.publish JSON.generate(data), routing_key: queue.name
|
32
|
+
exchange.publish JSON.generate(data) , routing_key: queue.name
|
33
33
|
end
|
34
34
|
|
35
35
|
def publish_sync(queue, data)
|
@@ -48,7 +48,7 @@ module RunRabbitRun
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def connection
|
51
|
-
@connection ||= AMQP.connect(host: '127.0.0.1', username: "guest", password: "guest")
|
51
|
+
@connection ||= AMQP.connect(host: (ENV['RABBITMQ_HOST'] || '127.0.0.1'), username: "guest", password: "guest")
|
52
52
|
end
|
53
53
|
|
54
54
|
def channel
|
data/lib/run_rabbit_run/tasks.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "run_rabbit_run"
|
2
|
+
require 'bunny'
|
2
3
|
|
3
4
|
namespace :rrr do
|
4
5
|
desc 'Starts profile workers'
|
@@ -16,6 +17,19 @@ namespace :rrr do
|
|
16
17
|
RunRabbitRun::Master.reload
|
17
18
|
end
|
18
19
|
|
20
|
+
desc 'kills all processes with the name RunRabbitRun only on UNIX'
|
21
|
+
task :kill_workers do
|
22
|
+
system("kill `ps -ef | grep RunRabbitRun | grep -v grep | awk '{print $2}'`")
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'delete all of the queues'
|
26
|
+
task :reset do
|
27
|
+
system("rabbitmqctl stop_app")
|
28
|
+
system("rabbitmqctl reset")
|
29
|
+
system("rabbitmqctl start_app")
|
30
|
+
end
|
31
|
+
|
32
|
+
|
19
33
|
namespace :worker do
|
20
34
|
desc 'Adds one process for given worker'
|
21
35
|
task :add, [ :worker_name ] => [ :config ] do | t, args |
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run_rabbit_run
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
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-04-
|
12
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 1.8.
|
150
|
+
rubygems_version: 1.8.23
|
151
151
|
signing_key:
|
152
152
|
specification_version: 3
|
153
153
|
summary: RunRabbitRun gem lets to run and manage multiple ruby processes for RabbitMQ
|