Skip to main content

Specify a timeout with any given function

Project description

Build Status


Python module for specifying timeouts when executing functions


To install this package, run the following command:

$ pip install bombfuse


>>> import time
>>> import bombfuse
>>> import sys
>>> # here's an infinite loop
>>> def func(msg):
>>>     while True:
>>>         time.sleep(1)
>>>         sys.stdout.write(msg + "\n")
>>>         sys.stdout.flush()
>>> # time out in 5 seconds
>>> bombfuse.timeout(5, func, "Hello world!")
Hello world!
Hello world!
Hello world!
Hello world!
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "bombfuse\", line 64, in timeout
    raise e
bombfuse.TimeoutError: The function 'func' timed out

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bombfuse-0.3.3.tar.gz (3.1 kB view hashes)

Uploaded source

Built Distribution

bombfuse-0.3.3-py3-none-any.whl (3.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page