Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Re-use the client object across multiple threads

Focus mode
Re-use the client object across multiple threads - Amazon Neptune

Re-use the same client (or GraphTraversalSource) object across multiple threads. That is, create a shared instance of a org.apache.tinkerpop.gremlin.driver.Client class in your application rather than doing so in every thread. The Client object is thread safe, and the overhead of initializing it is considerable.

This also applies to GraphTraversalSource, which creates a Client object internally. For example, the following code causes a new Client object to be instantiated:

import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal; ///// GraphTraversalSource traversal = traversal() .withRemote(DriverRemoteConnection.using(cluster));
PrivacySite termsCookie preferences
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.