.... and is it a good idea???

I am thinking of writing a controlling module - call it a postmaster if
you will - that will start submodules and pass them work via queues -
one input queue per module. The modules will send their results back to
the postmaster via its queue. The postmaster will then read the
incoming message and, if necessary, pass it on to another thread.

The problem is that I want the submodules NOT to be known by or part of
the original module. So I have to load them as the need is seen,
probably by name, and tie them to queues. Can anyone see a problem with
this or some good way to do it?

Maybe,

modname = ....... #Module name a variable
exec("import %s as mod" % modname)
module_input_queue = Queue.Queue()
new_thread = mod.classname(
   my_queue, module_input_queue, parms)
new_thread.start()

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to