You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Eric Smith <er...@fruitcom.com> on 2000/11/05 00:48:04 UTC

input from external process

Hi

Is it possible to have an existing mod_perl application read from an
external process?  The case in point is procmail piping mails to the
mod_perl application.  With high volumes of email, we would prefer not
to have to launch the perl interpreter each time to perform the tasks
specified by the incoming email.

Nasty way of effecting this communication is to have each mail message
saved to a file and do a readdir every time interval.

Is it possible to have the mod_perl process listen on a socket (or
something) that procmail may write to?

-- 
Eric Smith
Fruitcom.com Amsterdam
Wire phone : +31 20 528 7340
Mobile: +31 6 241 259 16
www.fruitcom.com

Re: input from external process

Posted by barries <ba...@slaysys.com>.
Have you found a workable approach yet?  Just curious :-).

- Barrie

Re: input from external process

Posted by barries <ba...@slaysys.com>.
On Sun, Nov 05, 2000 at 01:48:04AM +0200, Eric Smith wrote:
> 
> Nasty way of effecting this communication is to have each mail message
> saved to a file and do a readdir every time interval.

Ugh.  You're not talking mod_perl here, though, are you?

> Is it possible to have the mod_perl process listen on a socket (or
> something) that procmail may write to?

Not really, Apache won't listen on a Unix domain socket AFAICS.  However,
you *might* be able to write a little daemon that forwards from a
Unix domain socket that procmail could open to a TCP socket.  But then
you could just hang your code in that daemon.  Or you could hack Apache.
Or see if Apache 2.0 has that functionality yet.

Perhaps your best bet is to code a simple perl daemon to listen on a
Unix domain socket (no mod_perl involved).  It's not that hard, see
the perlipc man page and wander around CPAN.

I've been pondering the effects of making a caching front end server
talk to the back end mod_perl server via unix domain sockets, but I think
the cache and the back end servers end up on separate machines so often it
wouldn't be that useful a hack.  And now that mod_backhand supports HTTP/1.1
keep-alive connections to each mod_perl server in the "back end", there's
very little TCP connect/close handshake time to worry about, it seems.

- Barrie

Re: input from external process

Posted by Greg Cope <gr...@rubberplant.freeserve.co.uk>.
Eric Smith wrote:
> 
> Hi
> 
> Is it possible to have an existing mod_perl application read from an
> external process?  The case in point is procmail piping mails to the
> mod_perl application.  With high volumes of email, we would prefer not
> to have to launch the perl interpreter each time to perform the tasks
> specified by the incoming email.
> 
> Nasty way of effecting this communication is to have each mail message
> saved to a file and do a readdir every time interval.
> 
> Is it possible to have the mod_perl process listen on a socket (or
> something) that procmail may write to?

Why not write a perl server that lisens to a socket ?

Regards

Greg Cope


> 
> --
> Eric Smith
> Fruitcom.com Amsterdam
> Wire phone : +31 20 528 7340
> Mobile: +31 6 241 259 16
> www.fruitcom.com