Skip to content

Commit 46ef6a5

Browse files
committed
Some more documentation.
1 parent 8da527c commit 46ef6a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/async/service/configuration.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def empty?
4747
@environments.empty?
4848
end
4949

50+
# Enumerate all services in the configuration.
51+
#
52+
# A service is an environment that has a `service_class` key.
53+
#
54+
# @parameter implementing [Module] If specified, only services implementing this module will be returned/yielded.
55+
# @yields {|service| ...} Each service in the configuration.
5056
def services(implementing: nil)
5157
return to_enum(:services, implementing: implementing) unless block_given?
5258

@@ -59,6 +65,9 @@ def services(implementing: nil)
5965
end
6066
end
6167

68+
# Create a controller for the configured services.
69+
#
70+
# @returns [Controller] A controller that can be used to start/stop services.
6271
def controller(**options)
6372
Controller.new(self.services(**options).to_a)
6473
end

0 commit comments

Comments
 (0)