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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 298359af4a59278811fecb5a4286f1690e6f1890
4
- data.tar.gz: 5f62a03da44f79e0dcf278e213e1df282b7f00c6
3
+ metadata.gz: 1a07ed8172ccb8566701408cdcd049d3bc0802b4
4
+ data.tar.gz: a469b26a35c71c25b1317392365b87e938944087
5
5
  SHA512:
6
- metadata.gz: 1b006ef0eba8d0d12e2fb0d8cf7d984b2e2e1d7d24d06face5854d4e25ba211faaaae51e2990f463727baf56c8a40b76868eb834037a0cd034775e69bb475bf5
7
- data.tar.gz: 995f5ccac9f167d846c1f86e1a33b2d534150220f1f338fd3b700281811514e46d01c89b5337d93e3eccadf8e656f9abe5e9f0c99f6af165ebfc64513b7da0be
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 projet [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.
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
 
@@ -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
- producer.deliver_messages
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
@@ -1,3 +1,3 @@
1
1
  module Phobos
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
  end
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.1
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-08-22 00:00:00.000000000 Z
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.12
302
+ rubygems_version: 2.6.13
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: Simplifying Kafka for ruby apps