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

Option to block main thread when serving metrics #314

Closed
NotAFile opened this issue Sep 29, 2018 · 2 comments
Closed

Option to block main thread when serving metrics #314

NotAFile opened this issue Sep 29, 2018 · 2 comments

Comments

@NotAFile
Copy link

When writing exporters, I usually want the program to run indefinitely once I call start_http_server. Currently, I need to add a workaround using e.g. while True: sleep(100). It would be nicer if there was a block=True or similar kwarg which would hang the main thread instead.

This seems simple enough that I might try add it myself if I get a positive reaction.

@Shtsh
Copy link

Shtsh commented Oct 30, 2018

signal.pause() would be a better solution

https://docs.python.org/3/library/signal.html#signal.pause

@brian-brazil
Copy link
Contributor

It's one line of code for the user to add, so I don't see a big need to expand the API.

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

No branches or pull requests

3 participants