Fabian von Feilitzsch 15345e1620
[python] Cleanup ThreadPool with atexit rather than __del__ (#5094)
* [python] Cleanup ThreadPool with atexit rather than __del__

This removes the `__del__` function from the generated Python client,
and replaces it with a `cleanup` function. When a ThreadPool is created,
the cleanup function is registered with the `atexit` module.

This fixes #5093, where the API client could hang indefinitely at
garbage collection.

* Update petstore examples

* Test to ensure threadpool is cleaned up

* Docs now encourage using the context manager

* Regenerate docs

* Update samples
2020-01-28 21:58:11 -08:00

1.4 KiB

petstore_api.DefaultApi

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
foo_get GET /foo

foo_get

InlineResponseDefault foo_get()

Example

from __future__ import print_function
import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint

# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = petstore_api.DefaultApi(api_client)
    
    try:
        api_response = api_instance.foo_get()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->foo_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

InlineResponseDefault

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
0 response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]