On Sun, Aug 24, 2003 at 10:51:08PM -0500, Jake wrote:
> Rocco,
> 
> thanks for the reply.  I afraid I'm being thick and|or I was unclear.  Don't
> your changes require a client?
> 
> I want to have a process that runs routinely and on demand.  I want it to
> run routinely, regardless if there is a client connected or not.  When the
> client requests, I want to run the routine immediately.
> 
> Jay

That would probably be my fault.

You can start your own POE::Session instances before calling
POE::Kernel->run().

  # Start a session to do something occasionally.
  POE::Session->create(
    inline_states => {
      _start => sub {
        $_[KERNEL]->delay( something => 60 );
      },
      something => sub {
        print "Did something.\n";
        $_[KERNEL]->delay( something => 60 );
      },
    },
  );

This will operate independently of the TCP server.  If it must pass
statuses back to TCP clients, try a connection registry like the one at
http://poe.perl.org/?POE_Cookbook/Chat_Server

-- 
Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/

Reply via email to