On Wed, Oct 09, 2013 at 09:44:09AM -0400, Vikas N Kumar <[email protected]> 
wrote:
> In your documentation you mention that nobody uses Prima. I am using it
> and yes I understand it is a small user base but it has great support

(Nevertheless, it actually is supported by AnyEvent)

> Do I still need to call AnyEvent->condvar->recv ? Prima already has a
> Prima::run event loop calling module. Do you think the tcp_connect()
> will automatically get called by Prima's event loop.

You don't need a condvar at all in AnyEvent, calling the event loop run
function is fine.

The complication is that Prima is only supported via POE, so you need to tell
POE which event loop is the right one.

As long as you have POE::Loop::Prima is installed, there should be no need to
do anything on your side (according to the POE::Kernel docs, it will be used
automatically as long as Prima is loaded first).

You can force it's use via:

   use POW 'Loop::Prima';

On Wed, Oct 09, 2013 at 01:04:41PM -0400, Vikas N Kumar <[email protected]> 
wrote:
> Answering my own question. One should not use "run Prima" but create an

No, you really should use run Prima. Using a timer somehow works, but of
course makes your program spin in a loop, wasting all this electricity and
so on :)

Basically, the AnyEvent model works like this: as long as you have a
supported event loop (in this case POE::Loop::Prima and POE), and the
event loop design is not braindamaged (e.g. not IO::Async), then you
need to do nothing to make AnyEvent work - any code using AnyEvent (e.g.
tcp_server) will transparently integrate itself into the event loop,
without a need for condvars or any other magic.

If it didn't work for you, you probably lacked the POE::Loop::Prima module
that is required to interface to it - or maybe it somehow doesn't work
anymore, as Prima indeed sees very little use.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
anyevent mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/anyevent

Reply via email to