Skip to content

Option to block main thread when serving metrics #314

Closed

Description

@NotAFile

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.

Activity

  1. Shtsh commented on Oct 30, 2018

    @Shtsh

    signal.pause() would be a better solution

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

  2. brian-brazil commented on Feb 19, 2019

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions