Listener: Listener
Represents a Service listener endpoint.
Constructor
Initiliazes the websubhub:Listener
instance.
1listener websubhub:Listener hubListenerEp = check new (9090);
init (int | Listener listenTo, *ListenerConfiguration config)
- config *ListenerConfiguration
Custom
websubhub:ListenerConfiguration
to be provided to the underlying HTTP listener
LifeCycle Methods
attach | Attaches the provided |
Methods
detach | Detaches the provided |
'start | Starts the registered service programmatically. |
gracefulStop | Gracefully stops the hub listener. |
immediateStop | Stops the service listener immediately. |
attach
Attaches the provided websubhub:Service
to the websubhub:Listener
.
1check hubListenerEp.attach('service, "/hub");
Parameters
- 'service Service
The websubhub:Service
object to attach
Return Type
(Error?)An websubhub:Error
if an error occurred during the service attaching process or else ()
detach
Detaches the provided websubhub:Service
from the websubhub:Listener
.
1check hubListenerEp.detach('service);
Parameters
- s Service
The websubhub:Service
object to be detached
Return Type
(Error?)An websubhub:Error
if an error occurred during the service detaching process or else ()
gracefulStop
function gracefulStop() returns Error?
Gracefully stops the hub listener. Already-accepted requests will be served before the connection closure.
1check hubListenerEp.gracefulStop();