Hi

I am trying to build an application that acts as a server & bridge
between multiple types of client applications. It listens on two
different ports for multiple clients of two types. For this I have
created the listen socket and used AnyEvent->io() to monitor these
sockets. I also have this app connect to more than one database and wait
for push notifications from these data sources which are then sent to
selective clients that are connected to it as mentioned earlier.

However, I see that tcp_server in AnyEvent::Socket already does the
listen/accept part and I want to simplify my code to use that. However,
since I am handling multiple events on the same event loop so far I am
confused on how to merge that with the tcp_server() calls. Also, if
there is a lot of data being sent on the sockets, the program slows down
in the callbacks due to processing speed issues.

I have a few  questions which if answered can help me further:
- Does the tcp_server() call use the same event loop as the default
AnyEvent loop when I do AnyEvent->condvar ? If not, how does one access
that event loop and does it run in a separate thread then ?
- Can I use Coro to create 2 separate AnyEvent main loops ? This can be
done in libev very easily so I was wondering if I can do that in AnyEvent ?
- How does one measure performance of an application using multiple
events in AnyEvent ?

Thanks
Vikas.

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

Reply via email to