Search in sources :

Example 6 with CypherGremlinClient

use of org.opencypher.gremlin.client.CypherGremlinClient in project cypher-for-gremlin by opencypher.

the class CypherGremlinServerClient method async.

@Test
public void async() {
    CypherGremlinClient cypherGremlinClient = gremlinServer.cypherGremlinClient();
    // freshReadmeSnippet: async
    String cypher = "MATCH (p:person) WHERE p.age > 25 RETURN p.name";
    CompletableFuture<CypherResultSet> future = cypherGremlinClient.submitAsync(cypher);
    future.thenApply(CypherResultSet::all).thenAccept(resultSet -> {
    // ...
    });
// freshReadmeSnippet: async
}
Also used : CypherResultSet(org.opencypher.gremlin.client.CypherResultSet) CypherGremlinClient(org.opencypher.gremlin.client.CypherGremlinClient) Test(org.junit.Test)

Aggregations

CypherGremlinClient (org.opencypher.gremlin.client.CypherGremlinClient)6 Test (org.junit.Test)5 Map (java.util.Map)4 Client (org.apache.tinkerpop.gremlin.driver.Client)3 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)2 Cluster (org.apache.tinkerpop.gremlin.driver.Cluster)2 CypherResultSet (org.opencypher.gremlin.client.CypherResultSet)2 GraphTraversalSource (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource)1 TinkerGraph (org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph)1