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

Ensure host server waits with forwarding requests to worker #2754

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Apr 7, 2024

This PR moves the state of the host server into the AppContext class. (I say "state" but it's just the worker and whether the backend is ready.) This makes it easier to control access to the worker. I made the worker a private field and give it out via 2 methods: get_worker and get_worker_unmanaged. The difference between these two is that get_worker will wait until the backend is fully ready, while get_worker_unmanaged will not. So code that wants to use the worker has to declare whether it wants a ready worker or a worker in any state.

This fixes the loading issue we talked about here.

@joeyballentine joeyballentine merged commit 0c0edbb into chaiNNer-org:main Apr 7, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the server-ready branch April 7, 2024 19:03
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.

2 participants