mirror of https://github.com/reiseburo/hermann
9bfd7ad2e6
This ensures that we're getting async values out of librdkafka into the calling Ruby thread. Currently errors aren't being brought up properly, but we're getting there Example: [14:47:30] tyler:Hermann git:(issues/11-producer-feedback*) $ pry -I lib -r 'hermann/producer' [1] pry(main)> p = Hermann::Producer.new('topic', 'kafka0.REDACTED.com:6667') => #<Hermann::Producer:0x00000803b3b450 @brokers="kafka0.REDACTED.com:6667", @children=[], @internal=#<Hermann::Lib::Producer:0x00000803b3b3d8>, @topic="topic"> [2] pry(main)> r = p.push('hello world!') => #<Hermann::Result:0x00000803b8cb20 @producer= #<Hermann::Producer:0x00000803b3b450 @brokers="kafka0.REDACTED.com:6667", @children=[#<Hermann::Result:0x00000803b8cb20 ...>], @internal=#<Hermann::Lib::Producer:0x00000803b3b3d8>, @topic="topic">, @reason=nil, @state=:unfulfilled, @value=nil> [3] pry(main)> r.state => :unfulfilled [4] pry(main)> r.value ticking rdkafka reactor ticked => "hello world!" [5] pry(main)> r.state => :fulfilled [6] pry(main)> r.rejected? => false [7] pry(main)> [14:47:56] tyler:Hermann git:(issues/11-producer-feedback*) $ Fixes #11 |
||
---|---|---|
.. | ||
hermann_lib | ||
consumer_spec.rb | ||
hermann_spec.rb | ||
producer_spec.rb | ||
result_spec.rb | ||
spec_helper.rb |