Package turbomail :: Module pool :: Class MailPool
[hide private]
[frames] | no frames]

Class MailPool

source code

        object --+            
                 |            
threading._Verbose --+        
                     |        
      threading.Thread --+    
                         |    
                      Pool --+
                             |
                            MailPool

Mail delivery thread pool.

This class delivers messages from a queue using the Dispatch class.

Example usage:
       import turbomail
       pool = turbomail.MailPool()
       message = turbomail.Message(
                       "from@localhost",
                       "to@localhost",
                       "Subject"
               )
       message.plain = "Hello world!"
       pool.enqueue(message)
       # wait for message to send
       pool.shutdown()


Instance Methods [hide private]
 
worker(self)
Deliver up to jobs messages per queue.
source code

Inherited from Pool: __init__, enqueue, run, shutdown, spawn, wrapper

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

worker(self)

source code 

Deliver up to jobs messages per queue.

If there are no messages available in the queue, the worker will wait up to timeout seconds for data. If the timeout expires, the thread will exit gracefully.
Overrides: Pool.worker