Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic server class to handle common cases #8

Open
nthiery opened this issue Jul 1, 2018 · 0 comments
Open

Generic server class to handle common cases #8

nthiery opened this issue Jul 1, 2018 · 0 comments

Comments

@nthiery
Copy link

nthiery commented Jul 1, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant