Wolfgang-Schuetzelhofer / jcypher

Java access to Neo4J graph databases at multiple levels of abstraction
Apache License 2.0
86 stars 15 forks source link

async support #5

Closed yawnt closed 8 years ago

yawnt commented 9 years ago

It doesn't look like you can use an async http client to send requests to the Neo4j backend. It should be pretty trivial to fix:

in remote/RemoteDBAccess.java

// this
response = iBuilder.post(Entity.entity(json, MediaType.APPLICATION_JSON_TYPE));
// becomes
response = iBuilder.async().post(..., callback)

and we would need to have some .executeAsync() method added.

If need be, i'd be happy to contribute with a PR.. thoughts?

Wolfgang-Schuetzelhofer commented 9 years ago

Hi, I am today working with a customer, I will have look at the issue and contact you again tomorrow (Aug. 27).

Best regards, Wolfgang

-----Original Message----- From: ヨーント notifications@github.com To: Wolfgang-Schuetzelhofer/jcypher jcypher@noreply.github.com Sent: Tue, Aug 25, 2015 4:48 pm Subject: [jcypher] async support? (#5)

It doesn't look like you can use an async http client to send requests to the Neo4j backend. It should be pretty trivial to fix:

in remote/RemoteDBAccess.java

// this response = iBuilder.post(Entity.entity(json, MediaType.APPLICATION_JSON_TYPE)); // becomes response = iBuilder.async().post(..., callback)

and we would need to have some .executeAsync() method added.

If need be, i'd be happy to contribute with a PR.. thoughts?

— Reply to this email directly or view it on GitHub.

Wolfgang-Schuetzelhofer commented 9 years ago

Hi, before an async execution can work in a multithreaded environment, I have to do some work on threadsafety as JCypher maintains quite a lot of state information about a domain in memory. That work on threadsafety in order to allow multithreaded concurrent access has to be done anyway and is planned for the next release. Thereafter I will provide an executeAsync() just as you proposed.

Contributions and ideas are always welcome.

Best regards, Wolfgang

P.S.: I am out of office the next week