Listener -
grpc
: Listener
Represents server listener where one or more services can be registered. so that ballerina program can offer service through this listener.
Constructor
__init
(int port, ListenerConfiguration? config)
- port int
-
Listener port.
- config ListenerConfiguration? ()
-
The ServiceEndpointConfiguration of the endpoint.
Methods
LifeCycle Methods
Methods
Stops the registered service.
-
Return Type
(error) Returns an error if encounters an error while stopping the server, returns nil otherwise.
LifeCycle Methods
Starts the registered service.
-
Return Type
(error) Returns an error if encounters an error while starting the server, returns nil otherwise.
Gets called every time a service attaches itself to this endpoint - also happens at module init time.
Parameters
- s service
-
The type of the service to be registered.
- name string (default ())
-
Name of the service.
-
Return Type
(error) Returns an error if encounters an error while attaching the service, returns nil otherwise.