Assign component to a defined worker process

22 views
Skip to first unread message

Austin Holland

unread,
Mar 2, 2015, 10:34:30 AM3/2/15
to 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

unread,
Mar 2, 2015, 11:12:03 AM3/2/15
to 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

unread,
Mar 2, 2015, 3:02:09 PM3/2/15
to 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

unread,
Mar 4, 2015, 10:51:06 AM3/4/15
to circuit...@googlegroups.com
Is there a good example of doing that out there somewhere?

James Mills

unread,
Mar 4, 2015, 4:02:23 PM3/4/15
to 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

Reply all
Reply to author
Forward
0 new messages