Skip to content

Commit 3ac4e38

Browse files
committed
Update actor doc outputs
1 parent 0a1e25d commit 3ac4e38

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

doc/actor/define.out.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ def on_event(event)
3333
an_actor << :boo << Message.new(:add, 1)
3434
an_actor.ask!(Message.new(:value, nil)) # => 1
3535
an_actor << :terminate!
36-
# => #<Concurrent::Actor::Reference:0x7ff3ab16edc8 /an_actor (AnActor)>
36+
# => #<Concurrent::Actor::Reference:0x7fbedc137688 /an_actor (AnActor)>
3737

doc/actor/io.out.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def default_executor
1616
end
1717

1818
actor_doing_io = ActorDoingIO.spawn :actor_doing_io
19-
# => #<Concurrent::Actor::Reference:0x7ff3ab176b40 /actor_doing_io (ActorDoingIO)>
19+
# => #<Concurrent::Actor::Reference:0x7fbedc146e80 /actor_doing_io (ActorDoingIO)>
2020
actor_doing_io.executor == Concurrent.global_io_executor
2121
# => true
2222

@@ -37,10 +37,10 @@ def default_executor
3737
pool = Concurrent::Actor::Utils::Pool.spawn('pool', 2) do |index|
3838
IOWorker.spawn(name: "worker-#{index}")
3939
end
40-
# => #<Concurrent::Actor::Reference:0x7ff3abaac5c0 /pool (Concurrent::Actor::Utils::Pool)>
40+
# => #<Concurrent::Actor::Reference:0x7fbedba83378 /pool (Concurrent::Actor::Utils::Pool)>
4141

4242
pool << 1 << 2 << 3 << 4 << 5 << 6
43-
# => #<Concurrent::Actor::Reference:0x7ff3abaac5c0 /pool (Concurrent::Actor::Utils::Pool)>
43+
# => #<Concurrent::Actor::Reference:0x7fbedba83378 /pool (Concurrent::Actor::Utils::Pool)>
4444

4545
# prints two lines each second
4646
# /pool/worker-0 second:1414677666 message:1

doc/actor/messaging.out.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def on_message(message)
2424
end
2525

2626
calculator = Calculator.spawn('calculator')
27-
# => #<Concurrent::Actor::Reference:0x7ff3ab0c4f80 /calculator (Calculator)>
27+
# => #<Concurrent::Actor::Reference:0x7fbedba52d90 /calculator (Calculator)>
2828
addition = calculator.ask Add[1, 2]
29-
# => <#Concurrent::Edge::Future:0x7ff3ab08e188 pending blocks:[]>
29+
# => <#Concurrent::Promises::Future:0x7fbedc05f7b0 pending>
3030
substraction = calculator.ask Subtract[1, 0.5]
31-
# => <#Concurrent::Edge::Future:0x7ff3ab9de940 pending blocks:[]>
31+
# => <#Concurrent::Promises::Future:0x7fbedd891388 pending>
3232
results = (addition & substraction)
33-
# => <#Concurrent::Edge::Future:0x7ff3aa0b1b48 pending blocks:[]>
33+
# => <#Concurrent::Promises::Future:0x7fbedc04eeb0 pending>
3434
results.value! # => [3, 0.5]
3535

3636
calculator.ask! :terminate! # => true

doc/actor/quick.out.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ def on_message(message)
1717
# `link: true` makes the actor linked to root actor and supervised
1818
# which is default behavior
1919
adder = Adder.spawn(name: :adder, link: true, args: [1])
20-
# => #<Concurrent::Actor::Reference:0x7ff3ababf828 /adder (Adder)>
20+
# => #<Concurrent::Actor::Reference:0x7fbedd8e3d40 /adder (Adder)>
2121
adder.parent
22-
# => #<Concurrent::Actor::Reference:0x7ff3abad7ba8 / (Concurrent::Actor::Root)>
22+
# => #<Concurrent::Actor::Reference:0x7fbedbaa1e90 / (Concurrent::Actor::Root)>
2323

2424
# tell and forget
2525
adder.tell(:add).tell(:add)
26-
# => #<Concurrent::Actor::Reference:0x7ff3ababf828 /adder (Adder)>
26+
# => #<Concurrent::Actor::Reference:0x7fbedd8e3d40 /adder (Adder)>
2727
# ask to get result
2828
adder.ask!(:add) # => 4
2929
# fail the actor
30-
adder.ask!(:bad) rescue $! # => #<Concurrent::Actor::UnknownMessage: :bad>
30+
adder.ask!(:bad) rescue $!
31+
# => #<Concurrent::Actor::UnknownMessage: :bad from #<Thread:0x007fbedb8809b8>>
3132
# actor is restarted with initial values
3233
adder.ask!(:add) # => 2
3334
adder.ask!(:terminate!) # => true

doc/actor/supervision_tree.out.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ def on_message(msg)
4848
end
4949

5050
master = Master.spawn(name: 'master', supervise: true)
51-
# => #<Concurrent::Actor::Reference:0x7fa595899fa8 /master (Master)>
51+
# => #<Concurrent::Actor::Reference:0x7fbedc05e5e0 /master (Master)>
5252
listener = master.ask!(:listener)
53-
# => #<Concurrent::Actor::Reference:0x7fa5958909d0 /master/listener1 (Listener)>
54-
listener.ask!(:number) # => 12
53+
# => #<Concurrent::Actor::Reference:0x7fbedd86b840 /master/listener1 (Listener)>
54+
listener.ask!(:number) # => 39
5555
# crash the listener which is supervised by master, it's restarted automatically reporting a different number
5656
listener.tell(:crash)
57-
# => #<Concurrent::Actor::Reference:0x7fa5958909d0 /master/listener1 (Listener)>
58-
listener.ask!(:number) # => 65
57+
# => #<Concurrent::Actor::Reference:0x7fbedd86b840 /master/listener1 (Listener)>
58+
listener.ask!(:number) # => 73
5959

6060
master << :crash
61-
# => #<Concurrent::Actor::Reference:0x7fa595899fa8 /master (Master)>
61+
# => #<Concurrent::Actor::Reference:0x7fbedc05e5e0 /master (Master)>
6262

6363
sleep 0.1 # => 0
6464

6565
# ask for listener again, old one is terminated with master and replaced with new one
6666
listener.ask!(:terminated?) # => true
6767
listener = master.ask!(:listener)
68-
# => #<Concurrent::Actor::Reference:0x7fa5970d5608 /master/listener1 (Listener)>
69-
listener.ask!(:number) # => 77
68+
# => #<Concurrent::Actor::Reference:0x7fbedb929090 /master/listener1 (Listener)>
69+
listener.ask!(:number) # => 72
7070

71-
master.ask!(:terminate!) # => [[true], true]
71+
master.ask!(:terminate!) # => true
7272

7373
sleep 0.1 # => 0

0 commit comments

Comments
 (0)