carnivore 0.2.14 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/carnivore/callback.rb +1 -1
- data/lib/carnivore/message.rb +7 -0
- data/lib/carnivore/source.rb +20 -6
- data/lib/carnivore/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 011ab8b22ae76b8be44ce315fcf7a9b1a1a136c4
|
4
|
+
data.tar.gz: aefffbceab3c592743e3a542cb5b226822cfaae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15f085834d83fc162c2f3f937e695cd7a4ebafa3896103b2d73455c067f64f8211e1a97526527263c3805917428c87cae6b6cbb0d2bf79cd36c1f0a17c8433d3
|
7
|
+
data.tar.gz: 55dd49f607ce11a731c2d4155b3fbb758ebbf009c59917499e9222bc1df55cd1f0c5e6f67d197c5f4b99aab062adc46e070f4ec62e6062e172880805f55cca87
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# v0.2.16
|
2
|
+
* Log incoming messages at info level
|
3
|
+
* Add Source#touch method
|
4
|
+
* Rescue and log encoding errors on transmission (prevent fatal teardown)
|
5
|
+
* Add Message#touch proxy helper
|
6
|
+
|
1
7
|
# v0.2.14
|
2
8
|
* Always return `Smash` types when config value is `Hash`
|
3
9
|
|
data/lib/carnivore/callback.rb
CHANGED
@@ -64,7 +64,7 @@ module Carnivore
|
|
64
64
|
def call(message)
|
65
65
|
begin
|
66
66
|
if(valid?(message))
|
67
|
-
|
67
|
+
info ">> Received message is valid for this callback (#{message})"
|
68
68
|
execute(message)
|
69
69
|
else
|
70
70
|
debug "Invalid message for this callback #{message})"
|
data/lib/carnivore/message.rb
CHANGED
@@ -36,6 +36,13 @@ module Carnivore
|
|
36
36
|
self[:source].confirm(*([self] + args).flatten(1).compact)
|
37
37
|
end
|
38
38
|
|
39
|
+
# Touch message on source
|
40
|
+
#
|
41
|
+
# @return [TrueClass, FalseClass]
|
42
|
+
def touch!
|
43
|
+
self[:source].touch(self)
|
44
|
+
end
|
45
|
+
|
39
46
|
# @return [String] formatted inspection string
|
40
47
|
def inspect
|
41
48
|
"<Carnivore::Message[#{self.object_id}] @args=#{args.inspect}>"
|
data/lib/carnivore/source.rb
CHANGED
@@ -257,6 +257,15 @@ module Carnivore
|
|
257
257
|
raise NotImplemented.new('Abstract method not valid for runtime')
|
258
258
|
end
|
259
259
|
|
260
|
+
# Touch message to reset timeout
|
261
|
+
#
|
262
|
+
# @param message [Carnivore::Message]
|
263
|
+
# @return [TrueClass, FalseClass]
|
264
|
+
def touch(message)
|
265
|
+
warn 'Source#touch was not implemented for this source!'
|
266
|
+
true
|
267
|
+
end
|
268
|
+
|
260
269
|
# Confirm receipt of the message on source
|
261
270
|
#
|
262
271
|
# @param message [Carnivore::Message]
|
@@ -435,14 +444,19 @@ module Carnivore
|
|
435
444
|
# Send to local loop if processing otherwise use regular transmit
|
436
445
|
#
|
437
446
|
# @param args [Object] argument list
|
438
|
-
# @return [TrueClass]
|
447
|
+
# @return [TrueClass, FalseClass]
|
439
448
|
def _transmit(*args)
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
449
|
+
begin
|
450
|
+
if(loop_enabled? && processing)
|
451
|
+
loop_transmit(*args)
|
452
|
+
else
|
453
|
+
custom_transmit(*args)
|
454
|
+
end
|
455
|
+
true
|
456
|
+
rescue EncodingError => e
|
457
|
+
error "Transmission failed due to encoding error! Error: #{e.class} - #{e} [(#{args.map(&:to_s).join(')(')})]"
|
458
|
+
false
|
444
459
|
end
|
445
|
-
true
|
446
460
|
end
|
447
461
|
|
448
462
|
# Local message loopback is enabled. Custom sources should
|
data/lib/carnivore/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carnivore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|