Skip to content

Commit 3cb66e0

Browse files
committed
Use an ImmediateExecutor for Promise#flat_map not to schedule unneeded tasks
1 parent 5541da2 commit 3cb66e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent/promise.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def rescue(&block)
121121
def flat_map(&block)
122122
child = Promise.new(
123123
parent: self,
124-
executor: @executor,
124+
executor: ImmediateExecutor.new,
125125
)
126126

127127
on_error { |e| child.on_reject(e) }

0 commit comments

Comments
 (0)