Class: Async::GRPC::XDS::Server
- Inherits:
-
Object
- Object
- Async::GRPC::XDS::Server
- Defined in:
- lib/async/grpc/xds/server.rb
Overview
Convenience wrapper for serving an xDS control plane over gRPC.
Instance Attribute Summary collapse
-
#control_plane ⇒ Object
readonly
Returns the value of attribute control_plane.
-
#dispatcher ⇒ Object
readonly
Returns the value of attribute dispatcher.
Instance Method Summary collapse
-
#initialize(control_plane = ControlPlane.new, **options) ⇒ Server
constructor
A new instance of Server.
- #run(endpoint, **options) ⇒ Object
Constructor Details
#initialize(control_plane = ControlPlane.new, **options) ⇒ Server
Returns a new instance of Server.
17 18 19 20 21 22 |
# File 'lib/async/grpc/xds/server.rb', line 17 def initialize(control_plane = ControlPlane.new, **) @control_plane = control_plane @dispatcher = Async::GRPC::Dispatcher.new @dispatcher.register(Service.new(@control_plane)) @options = end |
Instance Attribute Details
#control_plane ⇒ Object (readonly)
Returns the value of attribute control_plane.
24 25 26 |
# File 'lib/async/grpc/xds/server.rb', line 24 def control_plane @control_plane end |
#dispatcher ⇒ Object (readonly)
Returns the value of attribute dispatcher.
25 26 27 |
# File 'lib/async/grpc/xds/server.rb', line 25 def dispatcher @dispatcher end |
Instance Method Details
#run(endpoint, **options) ⇒ Object
27 28 29 30 |
# File 'lib/async/grpc/xds/server.rb', line 27 def run(endpoint, **) server = Async::HTTP::Server.new(@dispatcher, endpoint, **@options, **) server.run end |