Metadata-Version: 2.1
Name: hapool
Version: 0.0.1
Summary: A handy, customizable python library that provides high availability for multiple node connections
Home-page: https://github.com/IMBlues/pyhapool
Author: Amazing Blues
Author-email: bluesedenyu@gmail.com
License: MIT
Description: 
        # pyhapool
        
        A handy, customizable python library that provides high availability(including failover etc.) for multiple node connections.
        
        ## Install
        
        ```python
        pip install hapool
        ```
        
        ## QuickStart
        
        For example, we need to connect to multiple kubernetes apiserver.
        ```python
        from pyhapool import HAEndpointPool
        from kubernetes.client import ApiClient
        
        # got configuration list which contain multiple apiservers
        configuration_list = [...]
        ha_pool = HAEndpointPool.from_list(configuration_list)
        
        
        class HAApiClient(ApiClient):
        
            def call_api(self, *args, **kwargs):
                while ha_pool.data:
                    with ha_pool.get_endpoint() as configuration:
                        self.configuration = configuration
                        return super().call_api(*args, **kwargs)
        ```
        
        If any apiserver became unavailable (may raise some exceptions), `ha_pool` would switch to next endpoint until any available one been chosen(work like upstream in `nginx`).
        
        ----
        
        more documentation is coming.
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.0
Description-Content-Type: text/markdown
