Skip to content

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
@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