You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upstart("SERVICE_NAME", False).start()
logger.debug("SERVICE is starting")
c=Client()
forxinrange(10):
r=c.get("/some/url")
ifr.code==204:
breakelse:
logger.debug("SERVICE has not started")
time.sleep(0.25)
logger.debug("SERVICE is ready")
It would be great if I could put just the meat into a callback and then the actual .start method will handle the looping and checking the return value of the callback.
This should be implemented in one of two ways, .start should take a check callback, and the service should have a .check method that returns True, so subclasses could override the .check method, or if they pass it in then it will be set to self.check.
The text was updated successfully, but these errors were encountered:
Currently, in some code I do something like this:
It would be great if I could put just the meat into a callback and then the actual
.start
method will handle the looping and checking the return value of the callback.This should be implemented in one of two ways,
.start
should take a check callback, and the service should have a.check
method that returns True, so subclasses could override the.check
method, or if they pass it in then it will be set toself.check
.The text was updated successfully, but these errors were encountered: