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

60 sofast curl interface #75

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

bbean23
Copy link
Collaborator

@bbean23 bbean23 commented Apr 9, 2024

No description provided.

Copy link
Collaborator

@braden6521 braden6521 Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add:

  • SpatialOrientation
  • DisplayShape
  • DotLocations
  • FacetDefinition (EnsembleDefinition if we want to support facet ensembles now)
  • Surface 2D definition

Copy link
Collaborator

@e10harvey e10harvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the critical sections for the threads?

+ f"It is suggested that you restrict outside access to port {port} of the host computer."
)
lt.info(f"Starting server on port {port}...")
server = HTTPServer(("0.0.0.0", port), SofastServer)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider storing "0.0.0.0" as a local variable above near where port is defined.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is a good idea and one I will implement.

Hey, sorry about the confusion. This PR isn't ready for review yet (if I assigned you already that was a mistake). I'll let you know when it is ready.

# The minimum time between server evaulation loops is determined by the GIL:
# https://docs.python.org/3/library/sys.html#sys.setswitchinterval
server_pool = ThreadPoolExecutor(max_workers=1)
server_pool.submit(server.serve_forever)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this thread crashes or throws an exception? Will the program exit cleanly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid concern and actually why I'm doing this work. The intent is to have a separate program that restarts the entire process if the server stops responding.

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

Successfully merging this pull request may close these issues.

3 participants