fluent-plugin-nats 0.0.2 → 0.0.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/Gemfile.lock +1 -1
- data/README.md +21 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/in_nats.rb +21 -6
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -19,3 +19,24 @@ Setup the NATS input:
|
|
19
19
|
queue fluent.>
|
20
20
|
</source>
|
21
21
|
~~~~~
|
22
|
+
|
23
|
+
# Suitable Queues
|
24
|
+
|
25
|
+
## Components
|
26
|
+
* dea.>
|
27
|
+
* cloudcontrollers.>
|
28
|
+
* router.>
|
29
|
+
* cloudcontroller.>
|
30
|
+
* vcap.>
|
31
|
+
* droplet.>
|
32
|
+
* healthmanager.>
|
33
|
+
|
34
|
+
## Services
|
35
|
+
* FilesystemaaS.>
|
36
|
+
* AtmosaaS.>
|
37
|
+
* MongoaaS.>
|
38
|
+
* MyaaS.>
|
39
|
+
* Neo4jaaS.>
|
40
|
+
* AuaaS.>
|
41
|
+
* RMQaaS.>
|
42
|
+
* RaaS.>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
@@ -11,7 +11,6 @@ module Fluent
|
|
11
11
|
def initialize
|
12
12
|
require "nats/client"
|
13
13
|
|
14
|
-
#["TERM", "INT"].each { |sig| trap(sig) { NATS.stop } }
|
15
14
|
NATS.on_error { |err| puts "Server Error: #{err}"; exit! }
|
16
15
|
super
|
17
16
|
end
|
@@ -28,7 +27,10 @@ module Fluent
|
|
28
27
|
def start
|
29
28
|
super
|
30
29
|
$log.info "listening nats on #{@uri}/#{@queue}"
|
30
|
+
@main_thread = Thread.current
|
31
31
|
@thread = Thread.new(&method(:run))
|
32
|
+
Thread.stop
|
33
|
+
@thread
|
32
34
|
end
|
33
35
|
|
34
36
|
def shutdown
|
@@ -38,11 +40,24 @@ module Fluent
|
|
38
40
|
end
|
39
41
|
|
40
42
|
def run
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
if EM.reactor_running?
|
44
|
+
$log.info "Reactor already running"
|
45
|
+
NATS.connect(:uri => @uri) {
|
46
|
+
NATS.subscribe(@queue) do |msg, reply, sub|
|
47
|
+
Engine.emit(sub, 0, msg)
|
48
|
+
end
|
49
|
+
@main_thread.wakeup
|
50
|
+
}
|
51
|
+
else
|
52
|
+
$log.info "Reactor not running. Starting..."
|
53
|
+
NATS.start(:uri => @uri) {
|
54
|
+
NATS.subscribe(@queue) do |msg, reply, sub|
|
55
|
+
Engine.emit(sub, 0, msg)
|
56
|
+
end
|
57
|
+
$log.info "Reactor running #{EM.reactor_running?}"
|
58
|
+
@main_thread.wakeup
|
59
|
+
}
|
60
|
+
end
|
46
61
|
end
|
47
62
|
end
|
48
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-nats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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: 2012-
|
12
|
+
date: 2012-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|