OpenMath/py-scscp

Generic server class to handle common cases

Opened this issue · 0 comments

Currently the demo server file is quite lengthy. It would be nice to have a base class with good default configuration so that, in the easy cases, running an SCSCP server could boil down to something like:

from scscp.server import SCSCPServer
srv = SCSCPServer()
srv.register_service(cdbase='...', cd='arith1', name='power', action=lambda x,y: x**y)
srv.serve_forever()

If case we would have a reasonable default set of services (maybe just apply, assuming we have a way to represent a Python function in OpenMath (as we do with openmath.convert_pickle), this could even boil down to:

    python -m scscp.server