[prev] [thread] [next] [lurker] [Date index for 2003/09/15]
Author: richardc Date: 2003-09-15 20:18:05 +0100 (Mon, 15 Sep 2003) New Revision: 1408 Modified: trunk/siesta/lib/Siesta/Deferred.pm trunk/siesta/lib/Siesta/Message.pm Log: move the resume code into the deferred class Modified: trunk/siesta/lib/Siesta/Deferred.pm =================================================================== --- trunk/siesta/lib/Siesta/Deferred.pm 2003-09-10 10:56:29 UTC (rev 1407) +++ trunk/siesta/lib/Siesta/Deferred.pm 2003-09-15 19:18:05 UTC (rev 1408) @@ -8,4 +8,30 @@ deflate => 'as_string', ); +=head1 NAME + +Siesta::Deferred - a deferred message in the system + +=head1 DESCRIPTION + +=head1 METHODS + +=head2 resume + +release a deferred message and continue it's processing + +=cut + +sub resume { + my $self = shift; + + my $mail = $self->message; + $mail->plugins([ map { + Siesta::Plugin->retrieve( $_ )->promote + } split /,/, $self->plugins ]); + + $self->delete; + $mail->process; +} + 1; Modified: trunk/siesta/lib/Siesta/Message.pm =================================================================== --- trunk/siesta/lib/Siesta/Message.pm 2003-09-10 10:56:29 UTC (rev 1407) +++ trunk/siesta/lib/Siesta/Message.pm 2003-09-15 19:18:05 UTC (rev 1408) @@ -10,7 +10,7 @@ =head1 NAME -Siesta::Message +Siesta::Message - a message in the system =head1 METHODS @@ -123,24 +123,18 @@ Siesta::Deferred->create({ @_, plugins => join(',', @{ $self->plugins } ), - message => $self->as_string, + message => $self, }); } + +# XXX compatibility shim, excise soonest sub resume { my $self = shift; - my $id = shift; - my $container = Siesta::Deferred->retrieve( $id ) - or croak "couldn't load $id"; + my $id = shift; - my $mail = $container->message; - $mail->plugins([ map { - Siesta::Plugin->retrieve( $_ )->promote - } split /,/, $container->plugins ]); - - $container->delete; - - $mail->process; + my $deferred = Siesta::Deferred->retrieve( $id ); + $deferred->resume; } sub process {
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52