Skip to content

Commit 5e6b6eb

Browse files
committed
Tidy up documentation.
1 parent 83c8ace commit 5e6b6eb

5 files changed

Lines changed: 17 additions & 13 deletions

File tree

context/migration.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ Replace all references to `Async::Container::Supervisor` with `Async::Service::S
6161
include Async::Container::Supervisor::Environment
6262
include Async::Container::Supervisor::Supervised
6363

64-
Async::Container::Supervisor::MemoryMonitor.new(...)
65-
Async::Container::Supervisor::ProcessMonitor.new(...)
64+
Async::Container::Supervisor::MemoryMonitor.new
65+
Async::Container::Supervisor::ProcessMonitor.new
6666

6767
# After:
6868
include Async::Service::Supervisor::Environment
6969
include Async::Service::Supervisor::Supervised
7070

71-
Async::Service::Supervisor::MemoryMonitor.new(...)
72-
Async::Service::Supervisor::ProcessMonitor.new(...)
71+
Async::Service::Supervisor::MemoryMonitor.new
72+
Async::Service::Supervisor::ProcessMonitor.new
7373
```
7474

7575
### 4. Update Worker Service Setup
@@ -237,7 +237,7 @@ client.connect do |connection|
237237
# Direct call-based API:
238238
result = connection.call(do: :restart)
239239
result = connection.call(do: :status)
240-
result = connection.call(do: :forward, operation: {...}, connection_id: "...")
240+
result = connection.call(do: :forward, operation: {do: :whatever}, connection_id: "...")
241241
end
242242
```
243243

@@ -253,7 +253,8 @@ client.connect do |connection|
253253

254254
# Worker operations use the worker controller:
255255
worker = connection[:worker]
256-
# Worker operations are available through the worker controller
256+
# Worker operations are available through the worker controller:
257+
worker.whatever
257258
end
258259
```
259260

guides/migration/readme.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ Replace all references to `Async::Container::Supervisor` with `Async::Service::S
6161
include Async::Container::Supervisor::Environment
6262
include Async::Container::Supervisor::Supervised
6363

64-
Async::Container::Supervisor::MemoryMonitor.new(...)
65-
Async::Container::Supervisor::ProcessMonitor.new(...)
64+
Async::Container::Supervisor::MemoryMonitor.new
65+
Async::Container::Supervisor::ProcessMonitor.new
6666

6767
# After:
6868
include Async::Service::Supervisor::Environment
6969
include Async::Service::Supervisor::Supervised
7070

71-
Async::Service::Supervisor::MemoryMonitor.new(...)
72-
Async::Service::Supervisor::ProcessMonitor.new(...)
71+
Async::Service::Supervisor::MemoryMonitor.new
72+
Async::Service::Supervisor::ProcessMonitor.new
7373
```
7474

7575
### 4. Update Worker Service Setup
@@ -237,7 +237,7 @@ client.connect do |connection|
237237
# Direct call-based API:
238238
result = connection.call(do: :restart)
239239
result = connection.call(do: :status)
240-
result = connection.call(do: :forward, operation: {...}, connection_id: "...")
240+
result = connection.call(do: :forward, operation: {do: :whatever}, connection_id: "...")
241241
end
242242
```
243243

@@ -253,7 +253,8 @@ client.connect do |connection|
253253

254254
# Worker operations use the worker controller:
255255
worker = connection[:worker]
256-
# Worker operations are available through the worker controller
256+
# Worker operations are available through the worker controller:
257+
worker.whatever
257258
end
258259
```
259260

lib/async/service/supervisor/supervisor_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Supervisor
1212
#
1313
# Handles registration of workers, worker lookup, restarting process groups, and status queries.
1414
class SupervisorController < Async::Bus::Controller
15+
# Initialize the supervisor controller with the server and connection.
1516
def initialize(server, connection)
1617
@server = server
1718
@connection = connection

lib/async/service/supervisor/worker_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module Supervisor
1313
#
1414
# Handles diagnostic operations like memory dumps, thread dumps, scheduler dumps, etc.
1515
class WorkerController < Async::Bus::Controller
16+
# Initialize the worker controller for the worker.
1617
def initialize(worker)
1718
@worker = worker
1819
end

test/async/service/supervised.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def setup(container)
3434
it "can define a supervised service" do
3535
environment = Async::Service::Environment.build(root: @root) do
3636
name "simple-service"
37-
37+
3838
service_class {SimpleService}
3939

4040
include Async::Service::Supervisor::Supervised

0 commit comments

Comments
 (0)