Listener - http : Listener

This is used for creating HTTP server endpoints. An HTTP server endpoint is capable of responding to remote callers. The Listener is responsible for initializing the endpoint using the provided configurations.

Methods

Stops the service listener gracefully.

Stops the service listener immediately.

Detaches a Http or WebSocket service from the listener.

LifeCycle Methods

Starts the registered service programmatically.

Attaches a service to the listener.

Methods

__gracefulStop

()

returns error?
Isolated Function

Stops the service listener gracefully. Already-accepted requests will be served before connection closure.

  • Return Type

    (error?)
  • An error if an error occurred during the listener stopping process

__immediateStop

()

returns error?
Isolated Function

Stops the service listener immediately. It is not implemented yet.

  • Return Type

    (error?)
  • An error if an error occurred during the listener stop process

__detach

(service s)

returns error?
Isolated Function

Detaches a Http or WebSocket service from the listener. Note that detaching a WebSocket service would not affect The functionality of the existing connections.

Parameters

  • s service
  • The service to be detached

  • Return Type

    (error?)
  • An error if one occurred during detaching of a service or else ()

initEndpoint

()

returns error?
Isolated Function
  • Return Type

    (error?)

LifeCycle Methods

__start

()

returns error?
Isolated Function

Starts the registered service programmatically.

  • Return Type

    (error?)
  • An error if an error occurred during the listener starting process

__attach

(service s, string? name)

returns error?
Isolated Function

Attaches a service to the listener.

Parameters

  • s service
  • The service that needs to be attached

  • name string? (default ())
  • Name of the service

  • Return Type

    (error?)
  • An error an error occurred during the service attachment process or else nil