- Timestamp:
- 10/16/07 02:31:22 (1 year ago)
- Location:
- branches/2.0.5/turbomail
- Files:
-
- 4 modified
-
__init__.py (modified) (4 diffs)
-
dispatch.py (modified) (3 diffs)
-
message.py (modified) (2 diffs)
-
pool.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0.5/turbomail/__init__.py
r3 r24 23 23 Throughput using the default options is sufficient for most use: 24 24 100 messages in 45 seconds; just over 2 messages a second. Using 25 a greater number of threads, 10 vs. 4, 100 messag s take 3025 a greater number of threads, 10 vs. 4, 100 messages take 30 26 26 seconds; just over 3 messages a second. YMMV. Note that if a 27 27 thread is idle, it will immediately deliver requests added to … … 82 82 - I{mail.timeout} (Default: B{60}) Maximum time a worker thread 83 83 will wait for additional jobs, in seconds. 84 - I{mail.tls} (Defa lut: None) Enable or disable TLS, None will84 - I{mail.tls} (Default: None) Enable or disable TLS, None will 85 85 attempt to auto-detect TLS. This will not always work. 86 86 - I{mail.encoding} (Default: B{'us-ascii'}) Set the character … … 95 95 - utf-8-qp - I{Sets utf-8 to use quoted-printable encoding.} 96 96 Headers are not encoded. DIY. 97 - I{mail.polling} (Defau t: B{False}) If enabled, configures the97 - I{mail.polling} (Default: B{False}) If enabled, configures the 98 98 thread pool to poll every I{mail.interval} seconds for new 99 99 jobs. This may give performance benefits to the running … … 138 138 139 139 Additionally, you can configure your application to log TurboMail 140 events differently, in a more loggable and machine pars able way.140 events differently, in a more loggable and machine parseable way. 141 141 You do so by adding the following lines to the formatters section 142 142 of your log.cfg:: -
branches/2.0.5/turbomail/dispatch.py
r9 r24 46 46 @type username: string 47 47 48 @param password: The password to use during authent action.48 @param password: The password to use during authentication. 49 49 I{Optional.} 50 50 @type password: string … … 78 78 79 79 This process also automatically enables TLS, if available, and 80 authenticates against the username and password previous ally80 authenticates against the username and password previously 81 81 provided. 82 82 """ … … 119 119 debug mode has been enabled. 120 120 121 @param message: This param ater must be a callable which returns121 @param message: This parameter must be a callable which returns 122 122 a tuple of (from, to, message), where all three 123 123 are strings, and message is valid content for an -
branches/2.0.5/turbomail/message.py
r14 r24 222 222 """Produce the final MIME message. 223 223 224 Additi noally, if only a rich text part exits, strip the HTML to224 Additionally, if only a rich text part exits, strip the HTML to 225 225 produce the plain text part. (This produces identical output as 226 226 KID, although lacks reverse entity conversion -- &, etc.) … … 388 388 389 389 def __init__(self, sender, recipient, subject, template, variables={}, **kw): 390 """Store the addit onal template and variable information.390 """Store the additional template and variable information. 391 391 392 392 @param template: A dot-path to a valid KID template. -
branches/2.0.5/turbomail/pool.py
r10 r24 16 16 17 17 class Pool(Thread): 18 """A thread pool which checks regularily for new jobs and spawns processes18 """A thread pool which checks regularly for new jobs and spawns processes 19 19 as needed. 20 20 … … 24 24 25 25 def __init__(self, interval=10, threads=4, jobs=10, timeout=60, polling=False, **kw): 26 """Initialize the thread pool.26 """Initialize the thread pool. 27 27 28 28 @param interval: A delay, in seconds, between spawn runs. … … 72 72 @param block: Block code execution until there is a free slot in 73 73 the queue. If I{block} is True and I{timeout} is 74 None, block indefin ately.74 None, block indefinitely. 75 75 @type block: bool 76 76 … … 147 147 def worker(self): 148 148 """This method must be overridden in a subclass and is used to 149 perform the work of the thread pool.149 perform the work of the thread pool. 150 150 151 151 Will raise a NotImplementedError exception if not subclassed.""" … … 155 155 156 156 class MailPool(Pool): 157 """Mail delivery thread pool.157 """Mail delivery thread pool. 158 158 159 159 This class delivers messages from a queue using the Dispatch class.
