@@ -16,7 +16,7 @@ def initialize(core)
16
16
@core = Type! core , Core
17
17
end
18
18
19
- # tells message to the actor
19
+ # tells message to the actor, returns immediately
20
20
# @param [Object] message
21
21
# @return [Reference] self
22
22
def tell ( message )
@@ -25,16 +25,25 @@ def tell(message)
25
25
26
26
alias_method :<< , :tell
27
27
28
- # tells message to the actor
28
+ # @note it's a good practice to use tell whenever possible. Ask should be used only for
29
+ # testing and when it returns very shortly. It can lead to deadlock if all threads in
30
+ # global_task_pool will block on while asking. It's fine to use it form outside of actors and
31
+ # global_task_pool.
32
+ #
33
+ # sends message to the actor and asks for the result of its processing, returns immediately
29
34
# @param [Object] message
30
35
# @param [Ivar] ivar to be fulfilled be message's processing result
31
36
# @return [IVar] supplied ivar
32
37
def ask ( message , ivar = IVar . new )
33
38
message message , ivar
34
39
end
35
40
36
- # @note can lead to deadlocks, use only in tests or when you are sure it won't deadlock
37
- # tells message to the actor
41
+ # @note it's a good practice to use tell whenever possible. Ask should be used only for
42
+ # testing and when it returns very shortly. It can lead to deadlock if all threads in
43
+ # global_task_pool will block on while asking. It's fine to use it form outside of actors and
44
+ # global_task_pool.
45
+ #
46
+ # sends message to the actor and asks for the result of its processing, blocks
38
47
# @param [Object] message
39
48
# @param [Ivar] ivar to be fulfilled be message's processing result
40
49
# @return [Object] message's processing result
0 commit comments