AnyEvent::MP creating many nodes in one process

mikhail maluyk mikhail.maluyk at gmail.com
Mon Jun 7 10:06:31 CEST 2010


Hi list,

I'm building a multilayer system, first layer is web server(s) (there
might be more than one) which is also mp node.
That web server seeds on some port, and second layer, which is "client
manager" connects to web server's mp node.
Web server and client manager processes are expected to be long
running, and both have the same secret.

Now when some event occurs i want to create a new node (let's call it
worker node), in client manager process, which will be seed node.
This worker node doesn't have the same secret as client manager and
web server nodes have, in fact, every worker has different secret.
After worker node is up and running there might be a lot of
connections to worker node, from other nodes, which are not related to
overall architecture (but they will have the same secret as worker
node, so they can authenticate).

The problem is that i can't have a distinct process for every worker
node because the process is quite huge, and there would be a lot of
workers.
But in this scenario, worker node knows about web server node, since
%NODE var is global, i.e. every worker node knows every node which
client manager node knows. And it tries to connect to webserver node,
but the secret is different => connection fails.

So i have two ideas how to handle this, either
* make everything not global (probably hard, and not sensible)
* invent some sort of skip list, so that worker node can be configured
to skip nodes found in %NODE, in my case something like
  configure skipnodes => ["*"] should work

You're welcome with any other ideas, or commenting those stated above,
even with ideas that my overall architecture is wrong :)

AE::MP is great stuff btw.

-- 
Regards,
Mikhail



More information about the anyevent mailing list