File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11# master
22Bug Fixes:
33* [ RUBY-319] ( https://datastax-oss.atlassian.net/browse/RUBY-319 ) Support reading decimals in scientific notation with positive exponent.
4+ * [ RUBY-320] ( https://datastax-oss.atlassian.net/browse/RUBY-320 ) Cassandra::Future.all([ ] ).join hangs forever
45
56# 3.2.1
67
Original file line number Diff line number Diff line change @@ -204,7 +204,13 @@ def promise
204204 end
205205
206206 def all ( *futures )
207- futures = Array ( futures . first ) if futures . one?
207+ # May get called with varargs or an array of futures. In the latter case,
208+ # the first element in futures is the array of futures. Promote it.
209+ futures = Array ( futures . first ) if futures . one?
210+
211+ # Special case where there are no futures to aggregate.
212+ return Value . new ( [ ] ) if futures . empty?
213+
208214 monitor = Monitor . new
209215 promise = Promise . new ( @executor )
210216 remaining = futures . length
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ module Listeners
6969 futures << Future . error ( RuntimeError . new ( "something happened" ) )
7070 expect { Future . all ( futures ) . get } . to raise_error ( "something happened" )
7171 end
72+
73+ it 'trivially succeeds when there are no futures' do
74+ expect ( Future . all . get ) . to eq ( [ ] )
75+ expect ( Future . all ( [ ] ) . get ) . to eq ( [ ] )
76+ end
7277 end
7378
7479 describe ( '#get' ) do
You can’t perform that action at this time.
0 commit comments