Skip to content

Commit c110154

Browse files
committed
Add marking Completable module
1 parent f1cea8b commit c110154

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/concurrent/promises.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,13 @@ def async_callback_on_completion(state, executor, args, callback)
841841
end
842842
end
843843

844+
module Completable
845+
end
846+
844847
# A Event which can be completed by user.
845848
class CompletableEvent < Event
849+
include Completable
850+
846851
# Complete the Event, `raise` if already completed
847852
def complete(raise_on_reassign = true)
848853
complete_with COMPLETED, raise_on_reassign
@@ -855,6 +860,8 @@ def with_hidden_completable
855860

856861
# A Future which can be completed by user.
857862
class CompletableFuture < Future
863+
include Completable
864+
858865
# Complete the future with triplet od `success`, `value`, `reason`
859866
# `raise` if already completed
860867
# return [self]

0 commit comments

Comments
 (0)