MCPcopy Create free account
hub / github.com/aws/aws-cli / background

Function background

tests/integration/botocore/test_client_http.py:278–288  ·  view source on GitHub ↗
(target, args=(), timeout=60)

Source from the content-addressed store, hash-verified

276
277@contextmanager
278def background(target, args=(), timeout=60):
279 thread = threading.Thread(target=target, args=args)
280 thread.daemon = True
281 thread.start()
282 try:
283 yield target
284 finally:
285 thread.join(timeout=timeout)
286 if thread.is_alive():
287 msg = 'Background task did not exit in a timely manner.'
288 raise BackgroundTaskFailed(msg)
289
290
291def run_server(handler, port):

Calls 2

startMethod · 0.45

Tested by

no test coverage detected