arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
601 stars 107 forks source link

Documentation is unclear about when actual server connection occurs #804

Closed robross0606 closed 8 months ago

robross0606 commented 8 months ago

Unless I'm missing it, the documentation is very unclear about when initial connection to the database occurs. The documentation for new Database() implies a connection pool is created, but doesn't state if an actual network connection is initialized at that point. But initializing a network connection in a constructor feels like a bit of a code smell to me. Which API calls initialize an actual network connection?

pluma4345 commented 8 months ago

As ArangoDB uses HTTP and the driver currently uses HTTP1, connections are only opened as necessary rather than in advance. With keep-alive (the default), the connections will however be reused and may remain open after the first use.

pluma4345 commented 8 months ago

I'm converting this to a discussion as this is not really an bug or feature request.