improv.actor
#
Module Contents#
Classes#
Base class for an actor that Nexus |
|
Base class for an actor that Nexus |
|
Base class for an actor that Nexus |
|
Asynchronous run manager. Communicates with nexus core using q_sig and q_comm. |
|
Class containing definition of signals Nexus uses |
Attributes#
- improv.actor.logger#
- class improv.actor.AbstractActor(name, store_loc, method='fork')[source]#
Base class for an actor that Nexus controls and interacts with. Needs to have a store and links for communication Also needs to be responsive to sent Signals (e.g. run, setup, etc)
- setStoreInterface(client)[source]#
Sets the client interface to the store
- Parameters:
client (improv.store.StoreInterface) – Set client interface to the store
- setLinks(links)[source]#
General full dict set for links
- Parameters:
links (dict) – The dict to store all the links
- setCommLinks(q_comm, q_sig)[source]#
Set explicit communication links to/from Nexus (q_comm, q_sig)
- Parameters:
q_comm (improv.nexus.Link) – for messages from this actor to Nexus
q_sig (improv.nexus.Link) – signals from Nexus and must be checked first
- setLinkIn(q_in)[source]#
Set the dedicated input queue
- Parameters:
q_in (improv.nexus.Link) – for input signals to this actor
- setLinkOut(q_out)[source]#
Set the dedicated output queue
- Parameters:
q_out (improv.nexus.Link) – for output signals from this actor
- setLinkWatch(q_watch)[source]#
Set the dedicated watchout queue
- Parameters:
q_watch (improv.nexus.Link) – watchout queue
- addLink(name, link)[source]#
Function provided to add additional data links by name using same form as q_in or q_out Must be done during registration and not during run
- Parameters:
name (string) – customized link name
link (improv.nexus.Link) – customized data link
- getLinks()[source]#
Returns dictionary of links for the current actor
- Returns:
dictionary of links
- Return type:
dict
- put(idnames, q_out=None, save=None)[source]#
TODO: This is deprecated? Prefer using Links explicitly
- setup()[source]#
Essenitally the registration process Can also be an initialization for the actor options is a list of options, can be empty
- abstract run()[source]#
Must run in continuous mode Also must check q_sig either at top of a run-loop or as async with the primary function
Suggested implementation for synchronous running: see RunManager class below
- class improv.actor.ManagedActor(*args, **kwargs)[source]#
Bases:
AbstractActor
Base class for an actor that Nexus controls and interacts with. Needs to have a store and links for communication Also needs to be responsive to sent Signals (e.g. run, setup, etc)
- class improv.actor.AsyncActor(*args, **kwargs)[source]#
Bases:
AbstractActor
Base class for an actor that Nexus controls and interacts with. Needs to have a store and links for communication Also needs to be responsive to sent Signals (e.g. run, setup, etc)
- improv.actor.Actor#
- class improv.actor.AsyncRunManager(name, actions, links, runStore=None, timeout=1e-06)[source]#
Asynchronous run manager. Communicates with nexus core using q_sig and q_comm. To be used with [async with] Afterwards, the run manager listens for signals without blocking.