github Azure/azure-sdk-for-js @azure/cosmos_3.12.0

latest releases: @azure-rest/maps-search_2.0.0-beta.2, @azure-rest/maps-geolocation_1.0.0-beta.4, @azure-rest/maps-render_2.0.0-beta.1...
3 years ago

3.12.0 (2021-07-06)

Features Added

  • With the dropping of support for Node.js versions that are no longer in LTS, the dependency on @types/node has been updated to version 12. Read our support policy for more details.
  • Added background refresher for endpoints, and new ConnectionPolicy options. Refreshing defaults to true, and the default refresh rate is every 5 minutes.
const client = new CosmosClient({
  endpoint,
  key: masterKey,
  connectionPolicy: {
    ...defaultConnectionPolicy,
    endpointRefreshRateInMs: 700,
    enableBackgroundEndpointRefreshing: true
  }
})
  • Added client.dispose() for closing the endpoint refresher verbosely. Necessary when destroying the CosmosClient inside existing processes like an express web server, or when you want to destroy the client and create a new one in the same process.
const client = new CosmosClient()
client.dispose() // cancels background endpoint refreshing

Don't miss a new azure-sdk-for-js release

NewReleases is sending notifications on new releases.