Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Adds event to signal teosd is ready #276

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sr-gi
Copy link
Member

@sr-gi sr-gi commented Mar 15, 2021

This adds an event to teosd that can be used to check when it has finished bootstrapping. This is specially useful when testing, since otherwise arbitrary waits have to be added to avoid querying non initialised services.

Summary:

  • Adds a multiprocess event to the RPC server that gets set once it is ready
  • Adds a ping endpoint to the API that gets polled to check if the API is ready
  • Adds an event to teosd that gets set when the two previous events get set

close #214

sr-gi added 5 commits May 19, 2021 11:10
- The RPC is signaled with a multiprocess event
- The API is signaled by pinging the /ping endpoint until reachable*
- teosd is signaled once the two previous signals are received

* The reason why the API is not being signaled in the same way as the RPC is because `gunicorn` cannot be used with multiprocess, and the process has to be created using `subprocess`, which has no `Events` to be subscribed to.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a signal to notify when the teosd.py/TeosDaemon is done with bootstrapping
1 participant