I am exploring neo4j for a large scale optimization application. Basically, I have uploaded a graph of locations to neo4j DB. The use case is to find the shortest path between two nodes. I am able to do this using neo4jclient, however, I have to find the shortest paths between several nodes for each request and I was looking to use Task Parallel Library (c#, .net) to send cypher queries to neo4j for different pairs of locations "in-parallel" and then add up all the distances. I don't see an "async" method in the GraphClient interface in Neo4jClient. Has anyone implemented this kind of parallel cypher queries in .net or is it just not reasonable to expect this kind of parallelism with cypher?
2 Answers
0
votes
0
votes
Instead of
await query.ExecuteWithoutResultsAsync()
query.ExecuteWithoutResults();
you could use
Task.Run(() => query.ExecuteWithoutResultsAsync());
Task.Run(() => query.ExecuteWithoutResults());
because in this case it does not matter if the context is the same or different. All neo4j does is to run the query.