Polling Delivery Manager

Deliver messages in the background with regularly timed thread creation.

The Polling Manager is basically identical to the On-Demand Manager save for the fact that threads are created on a regular basis (relative to the number of messages in the queue) and not when mail is added to the queue.

Installation

This manager is included in the base TurboMail installation.

Usage

Use this as your application-wide manager by setting the following configuration directive:

mail.manager = "polling"

Calls to turbomail.send will enqueue a deep copy of the message and return True. As this manager always declares success when enqueueing a message, it can not be used for debugging. Exceptions encountered when a worker thread attempts to deliver a message will be logged.

Configuration

There are four configuration directives related to this plug-in:

mail.polling.threadsDefaults to 4.
The maximum number of threads to maintain.
mail.polling.divisorDefaults to 10.
For optimum performance, this value should be set to the estimated number of requests a single Provider instance of your chosen type can handle. For example, if using the SMTP Provider, this should match the mail.smtp.count configuration directive.
mail.polling.timeoutDefaults to 60.
This defines how long an idle thread will wait for a new message in the queue before dying of starvation or old age.
mail.polling.intervalDefaults to 60.
Define the delay between thread creation attempts, in seconds.

A maximum of mail.polling.threads will be created every mail.polling.interval seconds, with the number of concurrent threads to never exceed mail.polling.threads+1 at any given time. Worker thread creation occurs in a maintenance thread.