# Module solver_interfaces

class pysph.solver.solver_interfaces.CommandlineInterface

  command-line interface to the solver controller

class pysph.solver.solver_interfaces.CrossDomainXMLRPCRequestHandler(*args, directory=None, **kwargs)

  SimpleXMLRPCRequestHandler subclass which attempts to do CORS

  CORS is Cross-Origin-Resource-Sharing (http://www.w3.org/TR/cors/) which enables xml-rpc calls from a different domain than the xml-rpc server (such requests are otherwise denied)

  do_GET()

    Handle http requests to serve html/image files only

  do_OPTIONS()

    Implement the CORS pre-flighted access for resources

  end_headers()

    End response header with adding Access-Control-Allow-Origin

    This is done to enable CORS request from all clients

class pysph.solver.solver_interfaces.MultiprocessingClient(address=None, authkey=None, serializer='pickle', start=True)

  A client for the multiprocessing interface

  Override the run() method to do appropriate actions on the proxy instance of the controller object or add an interface using the add_interface methods similar to the Controller.add_interface method

  add_interface(callable)

    This makes it act as substitute for the actual command_manager

  start(connect=True)

    Spawn a server process for this manager object

class pysph.solver.solver_interfaces.MultiprocessingInterface(address=None, authkey=None, try_next_port=False)

  A multiprocessing interface to the solver controller

  This object exports a controller instance proxy over the multiprocessing interface. Control actions can be performed by connecting to the interface and calling methods on the controller proxy instance

  start(controller)

    Spawn a server process for this manager object

class pysph.solver.solver_interfaces.XMLRPCInterface(addr, requestHandler=<class 'pysph.solver.solver_interfaces.CrossDomainXMLRPCRequestHandler'>, logRequests=True, allow_none=True, encoding=None, bind_and_activate=True)

  An XML-RPC interface to the solver controller

  Currently cannot work with objects which cannot be marshalled (which is basically most custom classes, most importantly ParticleArray and numpy arrays)

  Constructor. May be extended, do not override.