Comments (3)
Ah, apparently
client = ComputeManagementClient(...)
client.config.keep_alive = True
makes the client instance not close the underlying session. Whether or that's safe, I have no idea...
from msrest-for-python.
Hi @akx
Currently, you have two ways to achieve this:
- Use the client as a context manager (
with ComputeManagementClient(**parameters) as client
) - Use the flag you found (and the
close()
method when done)
It was not activated in early SDK, and I didn't activated it by default with current SDK, because that's a breaking change. This code will leak socket connection for example:
for el in myloop():
client = ComputeClientManagement(**parameters)
client.virtual_machines.list(**el)
Next major version of client will introduce async, and I decided to make the pool enabled by default with a disclaimer in the ChangeLog.
Hope this clarify :). Thanks!
https://github.com/Azure/msrest-for-python#2018-04-18-version-0428
from msrest-for-python.
Was commited part of Autorest for Python 4.0.63 as the default behavior: enabled pool per client. This will be shipped at the same time as async support in the next couples of month. Being, if the SDK supports async, it means the connection pool is activated by default.
from msrest-for-python.
Related Issues (20)
- "deserialize" from base class Model should have types HOT 1
- If we flatten a constant, it's not getting serialized correctly HOT 1
- Unreachable assertion in test_conf_async_trio_requests HOT 1
- switch ci from travis to GitHub actions HOT 1
- Bug when serializing data with None in header HOT 2
- Incorrect HASH encountered when installing using pip
- Update serializer to honor the null sentinel from azure core
- A warning is logged while using msrest where urllib3 issues: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead
- allow models to deserialize an azure.core.rest.HttpResponse
- Allow using ConsumptionManagementClient as a context manager for HTTPS connections reuse
- [feature] Immutable, hashable models, with text representations
- msrest.serialization.Deserializer.deserialize_object() cannot handle subclasses HOT 2
- This repo is missing important files
- 0.7.0 incompatible with python 3.5? HOT 3
- msrest import error while deploying to azure app HOT 1
- Latest versions (`v0.7.0` and `v0.7.1`) don't have git tags
- versions 3.1.1 through 3.2.1 of oauthlib are vulnerable to CVE-2022-36087
- Serialize np.float64 as float HOT 2
- Question about certifi license compatibility HOT 1
- Failing tests with Python 3.12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msrest-for-python.