phobos 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/phobos/producer.rb +7 -1
- data/lib/phobos/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a07ed8172ccb8566701408cdcd049d3bc0802b4
|
4
|
+
data.tar.gz: a469b26a35c71c25b1317392365b87e938944087
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13915bc70544e1d24d2eb210e9615226272051a32b4c542ed93864b38a4315fbaaa4f8f6cd00bf88e70ce94feaed4db3ec4d4d8d16b4846b8973a4c6ce457dcc
|
7
|
+
data.tar.gz: 5d032d5fa7e24a03611212c08201042f9570d631551a580922ada7d7c91a120e7125e616b98ad429aa04f3cf32a76d336c286ac7265187b9bbb681666f2dadab
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## 1.4.2 (2017-09-29)
|
8
|
+
|
9
|
+
- [bugfix] Async publishing always delivers messages #33
|
10
|
+
|
7
11
|
## 1.4.1 (2017-08-22)
|
8
12
|
|
9
13
|
- [enhancement] Update dev dependencies to fix warnings for the new unified Integer class
|
data/README.md
CHANGED
@@ -118,7 +118,7 @@ $ phobos start -c /var/configs/my.yml -b /opt/apps/boot.rb
|
|
118
118
|
```
|
119
119
|
### <a name="usage-consuming-messages-from-kafka"></a> Consuming messages from Kafka
|
120
120
|
|
121
|
-
Messages from Kafka are consumed using __handlers__. You can use Phobos __executors__ or include it in your own
|
121
|
+
Messages from Kafka are consumed using __handlers__. You can use Phobos __executors__ or include it in your own project [as a library](#usage-as-library), but __handlers__ will always be used. To create a handler class, simply include the module `Phobos::Handler`. This module allows Phobos to manage the life cycle of your handler.
|
122
122
|
|
123
123
|
A handler must implement the method `#consume(payload, metadata)`.
|
124
124
|
|
data/lib/phobos/producer.rb
CHANGED
@@ -73,6 +73,7 @@ module Phobos
|
|
73
73
|
client = kafka_client || configure_kafka_client(Phobos.create_kafka_client)
|
74
74
|
producer = client.producer(regular_configs)
|
75
75
|
produce_messages(producer, messages)
|
76
|
+
producer.deliver_messages
|
76
77
|
ensure
|
77
78
|
producer&.shutdown
|
78
79
|
end
|
@@ -94,6 +95,7 @@ module Phobos
|
|
94
95
|
def async_publish_list(messages)
|
95
96
|
producer = async_producer || create_async_producer
|
96
97
|
produce_messages(producer, messages)
|
98
|
+
producer.deliver_messages unless async_automatic_delivery?
|
97
99
|
end
|
98
100
|
|
99
101
|
def async_producer_shutdown
|
@@ -119,7 +121,11 @@ module Phobos
|
|
119
121
|
partition_key: message[:key]
|
120
122
|
)
|
121
123
|
end
|
122
|
-
|
124
|
+
end
|
125
|
+
|
126
|
+
def async_automatic_delivery?
|
127
|
+
async_configs.fetch(:delivery_threshold, 0) > 0 ||
|
128
|
+
async_configs.fetch(:delivery_interval, 0) > 0
|
123
129
|
end
|
124
130
|
|
125
131
|
def producer_store
|
data/lib/phobos/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phobos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Túlio Ornelas
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2017-
|
16
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
301
|
rubyforge_project:
|
302
|
-
rubygems_version: 2.6.
|
302
|
+
rubygems_version: 2.6.13
|
303
303
|
signing_key:
|
304
304
|
specification_version: 4
|
305
305
|
summary: Simplifying Kafka for ruby apps
|