Skip to content

Commit 7e76547

Browse files
committed
If a block is given, flush and yield.
1 parent d1772e6 commit 7e76547

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/async/redis/context/pipeline.rb

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def flush(count = 0)
4747
end
4848

4949
def collect
50+
if block_given?
51+
flush
52+
yield
53+
end
54+
5055
@count.times.map{read_response}
5156
end
5257

0 commit comments

Comments
 (0)