This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Object - lang.object : Listener

Represents the shape expected from all listeners.

Methods

Handle service attachment to the listener.

Handle service detachment from the listener.

Handle listener start.

Handle listener graceful stop.

Handle listener immediate stop.

__attach

(service s, string? name)

returns error?

Handle service attachment to the listener.

Parameters

  • s service
  • the service to attach

  • name string? (default ())
  • optionally a name associated with the service

  • Return Type

    (error?)
  • () if no error occurred, and an error otherwise

__detach

(service s)

returns error?

Handle service detachment from the listener.

Parameters

  • s service
  • the service to detach

  • Return Type

    (error?)
  • () if no error occurred, and an error otherwise

__start

()

returns error?

Handle listener start.

  • Return Type

    (error?)
  • () if no error occurred, and an error otherwise

__gracefulStop

()

returns error?

Handle listener graceful stop.

  • Return Type

    (error?)
  • () if no error occurred, and an error otherwise

__immediateStop

()

returns error?

Handle listener immediate stop.

  • Return Type

    (error?)
  • () if no error occurred, and an error otherwise