File tree Expand file tree Collapse file tree 5 files changed +11
-10
lines changed Expand file tree Collapse file tree 5 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,5 @@ def on_event(event)
35
35
an_actor << :boo << Message . new ( :add , 1 )
36
36
an_actor . ask! ( Message . new ( :value , nil ) ) # => 1
37
37
an_actor << :terminate!
38
- # => #<Concurrent::Actor::Reference /an_actor (AnActor)>
38
+ # => #<Concurrent::Actor::Reference:0x7fd6451f78e0 /an_actor (AnActor)>
39
39
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def default_executor
16
16
end
17
17
18
18
actor_doing_io = ActorDoingIO . spawn :actor_doing_io
19
- # => #<Concurrent::Actor::Reference /actor_doing_io (ActorDoingIO)>
19
+ # => #<Concurrent::Actor::Reference:0x7fd6451fff40 /actor_doing_io (ActorDoingIO)>
20
20
actor_doing_io . executor == Concurrent . configuration . global_operation_pool
21
21
# => true
22
22
@@ -37,10 +37,10 @@ def default_executor
37
37
pool = Concurrent ::Actor ::Utils ::Pool . spawn ( 'pool' , 2 ) do |balancer , index |
38
38
IOWorker . spawn ( name : "worker-#{ index } " , supervise : true , args : [ balancer ] )
39
39
end
40
- # => #<Concurrent::Actor::Reference /pool (Concurrent::Actor::Utils::Pool)>
40
+ # => #<Concurrent::Actor::Reference:0x7fd6451ecaf8 /pool (Concurrent::Actor::Utils::Pool)>
41
41
42
42
pool << 1 << 2 << 3 << 4 << 5 << 6
43
- # => #<Concurrent::Actor::Reference /pool (Concurrent::Actor::Utils::Pool)>
43
+ # => #<Concurrent::Actor::Reference:0x7fd6451ecaf8 /pool (Concurrent::Actor::Utils::Pool)>
44
44
45
45
# prints two lines each second
46
46
# /pool/worker-0 second:1414677666 message:1
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ def on_message(message)
25
25
end
26
26
27
27
calculator = Calculator . spawn ( 'calculator' )
28
- # => #<Concurrent::Actor::Reference /calculator (Calculator)>
28
+ # => #<Concurrent::Actor::Reference:0x7fd646110700 /calculator (Calculator)>
29
29
calculator . ask! Add [ 1 , 2 ] # => 3
30
30
calculator . ask! Subtract [ 1 , 0.5 ] # => 0.5
31
31
calculator << :terminate!
32
- # => #<Concurrent::Actor::Reference /calculator (Calculator)>
32
+ # => #<Concurrent::Actor::Reference:0x7fd646110700 /calculator (Calculator)>
Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ def on_message(message)
16
16
17
17
# `supervise: true` makes the actor supervised by root actor
18
18
adder = Adder . spawn ( name : :adder , supervise : true , args : [ 1 ] )
19
- # => #<Concurrent::Actor::Reference /adder (Adder)>
19
+ # => #<Concurrent::Actor::Reference:0x7fd64420ac48 /adder (Adder)>
20
20
adder . parent
21
- # => #<Concurrent::Actor::Reference / (Concurrent::Actor::Root)>
21
+ # => #<Concurrent::Actor::Reference:0x7fd644229008 / (Concurrent::Actor::Root)>
22
22
23
23
# tell and forget
24
- adder . tell ( :add ) << :add # => #<Concurrent::Actor::Reference /adder (Adder)>
24
+ adder . tell ( :add ) << :add
25
+ # => #<Concurrent::Actor::Reference:0x7fd64420ac48 /adder (Adder)>
25
26
# ask to get result
26
27
adder . ask! ( :add ) # => 4
27
28
# fail the actor
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def dead_letter_routing
87
87
end
88
88
89
89
def to_s
90
- "#<#{ self . class } #{ path } (#{ actor_class } )>"
90
+ "#<#{ self . class } :0x #{ '%x' % ( object_id << 1 ) } #{ path } (#{ actor_class } )>"
91
91
end
92
92
93
93
alias_method :inspect , :to_s
You can’t perform that action at this time.
0 commit comments