| | 257 | __END__ |
| | 258 | |
| | 259 | =head1 NAME |
| | 260 | |
| | 261 | MT::TheSchwartz - Movable Type |
| | 262 | |
| | 263 | =head1 SYNOPSIS |
| | 264 | |
| | 265 | use MT; |
| | 266 | use MT::TheSchwartz; |
| | 267 | my $mt = MT->new; |
| | 268 | my $schwartz = MT::TheSchwartz->new(%cfg); |
| | 269 | $schwartz->work_until_done; |
| | 270 | |
| | 271 | =head1 DESCRIPTION |
| | 272 | |
| | 273 | A subclass of C<TheSchwartz>, a job queue system. The MT subclass is |
| | 274 | responsible for configuring TheSchwartz to work with the MT database |
| | 275 | configuration and supplies TheSchwartz worker classes from the MT |
| | 276 | registry. |
| | 277 | |
| | 278 | =head1 METHODS |
| | 279 | |
| | 280 | =head2 MT::TheSchwartz->instance |
| | 281 | |
| | 282 | Returns the singleton instance for the C<MT::TheSchwartz> class. |
| | 283 | |
| | 284 | =head2 MT::TheSchwartz->debug |
| | 285 | |
| | 286 | Static (or instance) method that simply forwards the parameters given on |
| | 287 | to the singleton instance. |
| | 288 | |
| | 289 | =head2 MT::TheSchwartz->insert |
| | 290 | |
| | 291 | Static (or instance) method that simply forwards the parameters given on |
| | 292 | to the singleton instance. |
| | 293 | |
| | 294 | =head2 $schwartz->default_logger($msg, $job) |
| | 295 | |
| | 296 | Handles logging messages for C<TheSchwartz>. When a log message is issued, |
| | 297 | this method takes over. In this case, this subclass suppresses the |
| | 298 | "job completed" messages issued by C<TheSchwartz>. |
| | 299 | |
| | 300 | =head2 $schwartz->work_periodically([$delay]) |
| | 301 | |
| | 302 | Invokes C<TheSchwartz> to process available jobs, then queries the MT |
| | 303 | session table for available MT registered tasks that may be ready to |
| | 304 | run. MT tasks such as publishing scheduled posts, expiration of |
| | 305 | spam comments and trackbacks, etc. This routine runs in an infinite |
| | 306 | loop-- after scheduled tasks are run, it will delay C<$delay> seconds |
| | 307 | (default of 5 seconds), then checks for more Schwartz jobs to process. |
| | 308 | |
| | 309 | =cut |