Class: ImapListener

Represents a service listener that monitors the email server location.

Constructor

Gets invoked during the email:ImapListener initialization.

init (ImapListenerConfiguration listenerConfig)

Methods

'start

Starts the email:ImapListener.

attach

Binds a service to the email:ImapListener.

detach

Stops consuming messages and detaches the service from the email:ImapListener.

immediateStop

Stops the email:ImapListener forcefully.

gracefulStop

Stops the email:ImapListener gracefully.

register

Registers for the Email service.

'start

function 'start() returns error?
Isolated Function

Starts the email:ImapListener.

1email:Error? result = emailListener.start();

Return Type

(error?)

() or else error upon failure to start the listener

attach

function attach(service object {}  s, string[ ] | string? name) returns error?
Isolated Function

Binds a service to the email:ImapListener.

1email:Error? result = emailListener.attach(helloService, hello);

Parameters

  • s service object {}
  • Type descriptor of the service

Return Type

(error?)

() or else a email:Error upon failure to register the listener

detach

function detach(service object {}  s) returns error?
Isolated Function

Stops consuming messages and detaches the service from the email:ImapListener.

1email:Error? result = emailListener.detach(helloService);

Parameters

  • s service object {}
  • Type descriptor of the service

Return Type

(error?)

() or else a email:Error upon failure to detach the service

immediateStop

function immediateStop() returns error?
Isolated Function

Stops the email:ImapListener forcefully.

1email:Error? result = emailListener.immediateStop();

Return Type

(error?)

() or else a email:Error upon failure to stop the listener

gracefulStop

function gracefulStop() returns error?
Isolated Function

Stops the email:ImapListener gracefully.

1email:Error? result = emailListener.gracefulStop();

Return Type

(error?)

() or else error upon failure to stop the listener

register

function register(service object {}  emailService, string? name)
Isolated Function

Registers for the Email service.

1emailListener.register(helloService, hello);

Parameters

  • emailService service object {}
  • Type descriptor of the service