Assign component to a defined worker process

22 wyświetlenia
Przejdź do pierwszej nieodczytanej wiadomości

Austin Holland

nieprzeczytany,
2 mar 2015, 10:34:302.03.2015
do circuit...@googlegroups.com
Is it possible when registering a component to assign a component to a defined worker.  I have some components which really do a lot of work and perhaps should be assigned to their own process.  So I am instituting some changes, but here is an example.  And it would be nice if each Component was assigned to a specific worker.  

class RTapp(Component):

  def __init__(self):

    super(RTapp,self).__init__()
    self.worker=Worker(process=True,workers=6).register(self)
    
    self.subnet_trigger=SubnetTrigger().register(self)
    self.wf=WaveForm().register(self)
    self.eq=Earthquake().register(self)
    self.report=Report().register(self)

Austin Holland

nieprzeczytany,
2 mar 2015, 11:12:032.03.2015
do circuit...@googlegroups.com
I was going to use a node server but am passing class instances around and it dawned on me that won't work.

James Mills

nieprzeczytany,
2 mar 2015, 15:02:092.03.2015
do circuit...@googlegroups.com
Hi,

You'd probably want to start that componnet
or component graph in "process mode"
which uses the bridge to do PIC between the child
and parent.

It's a bit different to Worker which just wraps around
multiprocessing.Pool.

But if you have issues pickling your objects this won't work either.
Unless you use a different serialization.

cheers
James

--
You received this message because you are subscribed to the Google Groups "circuits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circuits-user...@googlegroups.com.
To post to this group, send email to circuit...@googlegroups.com.
Visit this group at http://groups.google.com/group/circuits-users.
For more options, visit https://groups.google.com/d/optout.

Austin Holland

nieprzeczytany,
4 mar 2015, 10:51:064.03.2015
do circuit...@googlegroups.com
Is there a good example of doing that out there somewhere?

James Mills

nieprzeczytany,
4 mar 2015, 16:02:234.03.2015
do circuit...@googlegroups.com
Other than hello_bridge.py in examples/ [1] no not really.
If you give me a very simple use-case I'd be more
than happy to write a more specific example.

cheers
James

Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0