bi-frost 0.4.0 → 0.4.1
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.
- checksums.yaml +4 -4
- data/lib/bifrost/message.rb +2 -2
- data/lib/bifrost/version.rb +1 -1
- data/lib/bifrost/worker.rb +2 -3
- data/spec/bifrost/message_spec.rb +2 -2
- data/spec/bifrost/topic_spec.rb +0 -1
- data/spec/bifrost/worker_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -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: e3473e63e0afb70a565b476a6ff3b8e65ef87f96
|
4
|
+
data.tar.gz: df2842a9f4838f55156ea570c0c5a476326ec4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dfb17e4d710b6e52e70d13ef610878cb3086e2e007cf4549e72f53c381ff5f0e94109275d500a0ceefe60d4703e00cdb0e5a6ce52794a6c06887321a2816b6e
|
7
|
+
data.tar.gz: db30185a5cab2f29980fc8d59575207bd81df1887d66847013396b323c787e2088d3710597da7c6c20012ce337df5b2881688d96036eaaa9c8351eecf43d4e4b
|
data/lib/bifrost/message.rb
CHANGED
@@ -7,8 +7,8 @@ module Bifrost
|
|
7
7
|
class Message < Entity
|
8
8
|
attr_reader :meta, :body, :status, :message_id
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
alias resource_id message_id
|
11
|
+
alias id message_id
|
12
12
|
|
13
13
|
# A message must have a valid subject and body. The service
|
14
14
|
# bus is initialised in the Entity class
|
data/lib/bifrost/version.rb
CHANGED
@@ -9,7 +9,7 @@ module Bifrost
|
|
9
9
|
|
10
10
|
# The patch version of Bifrost, updated only for bug fixes from the last
|
11
11
|
# feature release.
|
12
|
-
PATCH_VERSION =
|
12
|
+
PATCH_VERSION = 1
|
13
13
|
|
14
14
|
# The full version as a string.
|
15
15
|
VERSION = "#{MAJOR_VERSION}.#{MINOR_VERSION}.#{PATCH_VERSION}".freeze
|
data/lib/bifrost/worker.rb
CHANGED
@@ -57,15 +57,14 @@ module Bifrost
|
|
57
57
|
|
58
58
|
# Actual processing of the message
|
59
59
|
def read_message
|
60
|
-
byebug
|
61
60
|
raw_message = @bus.interface.receive_subscription_message(topic, subscriber, timeout: ENV['TIMEOUT'] || 10)
|
62
61
|
if raw_message
|
63
62
|
info("Worker #{self} picked up message #{raw_message}") if Bifrost.debug?
|
64
63
|
message = Bifrost::Message.new(raw_message)
|
65
64
|
callback.call(message)
|
66
65
|
@bus.interface.delete_subscription_message(raw_message)
|
67
|
-
|
68
|
-
info("Worker #{self} no message...")
|
66
|
+
elsif Bifrost.debug?
|
67
|
+
info("Worker #{self} no message...")
|
69
68
|
end
|
70
69
|
end
|
71
70
|
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
require 'bifrost'
|
3
3
|
|
4
4
|
describe Bifrost::Message do
|
5
|
-
subject(:message) { Bifrost::Message.new({ content: 'some data' },
|
5
|
+
subject(:message) { Bifrost::Message.new({ content: 'some data' }, app_name: 'bifrost') }
|
6
6
|
|
7
7
|
it { is_expected.to respond_to(:meta) }
|
8
8
|
it { is_expected.to respond_to(:status) }
|
@@ -32,7 +32,7 @@ describe Bifrost::Message do
|
|
32
32
|
topic = Bifrost::Topic.new('valid-topic')
|
33
33
|
topic.save
|
34
34
|
topic.add_subscriber(Bifrost::Subscriber.new('new_subscriber'))
|
35
|
-
msg = Bifrost::Message.new(1,
|
35
|
+
msg = Bifrost::Message.new(1, app_name: 'bifrost')
|
36
36
|
expect(msg.publish(topic)).to be_truthy
|
37
37
|
end
|
38
38
|
|
data/spec/bifrost/topic_spec.rb
CHANGED
data/spec/bifrost/worker_spec.rb
CHANGED
@@ -31,7 +31,7 @@ describe Bifrost::Worker do
|
|
31
31
|
topic.save
|
32
32
|
subscriber = Bifrost::Subscriber.new('subscriber')
|
33
33
|
topic.add_subscriber(subscriber)
|
34
|
-
msg = Bifrost::Message.new([item1: { data: 2 }, item2: { more_data: 3 }],
|
34
|
+
msg = Bifrost::Message.new([item1: { data: 2 }, item2: { more_data: 3 }], app_name: 'bifrost')
|
35
35
|
msg.publish(topic)
|
36
36
|
expect(msg.status).to eq(:delivered)
|
37
37
|
expect(msg.message_id).not_to be_nil
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bi-frost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shirren Premaratne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: azure
|