-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling for multiple events in a transaction #172
Comments
@jrgleason Try this using bluebird Promises
Easiest to handle this using async/await or coroutines/yield. I'm also assuming that you'll either promisify mergeSource() using bluebird or manually construct a quick wrapper around it so that it returns a promise instead of firing a callback. (Edit for future readers:) Note the addition of {concurrency: 1} as an option, which ensures only one element of the array is executed at a time until its promise resolves. |
Right but I am pretty sure this doesn't work in a transaction since you are not waiting for the previous call to finish. This is why I needed to remove my promises |
Ahh nm missed the concurrency thing at the end. Interesting. |
Yes, that's definitely the kicker. It'll make sure every promise is executed sequentially. It's great fun :-) |
Sorry for the delay folks. Glad to hear you're unblocked for now. As mentioned in #164 (comment):
Curious what you guys think? |
Currently if try an async thread loop firing off Cypher requests Neo4J barfs saying 'you are trying to run requests while another is running'.
My work around for now is using the asynch library....
It would be nice if there was a way to handle this in node-neo4j
The text was updated successfully, but these errors were encountered: