-
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
v2 implementation! #145
base: master
Are you sure you want to change the base?
v2 implementation! #145
Conversation
246dde5
to
204ab38
Compare
694eab4
to
ad6fe67
Compare
My two cents: examples should be standard javascript without streamline. I had to look up the documentation for what streamline does to understand your docs.
Oboe.js does work in the browser :) It seems to be implied that transaction requests immediately (i.e. synchronously) return a stream. This is not technically correct. Due to buffering and batching it is currently asynchronous.
I also would prefer that |
Great point. Will fix.
Does it have to be the one making the HTTP request though? The API docs seem to imply that the "bring your own stream" feature is only in Node — but do you know if that's actually true in practice? http://oboejs.com/api#byo-stream
Really? This example shows https://github.com/brian-gates/cypher-stream#query-batching
I'm not sure if I'm misunderstanding you, but typically, options in options objects can simply be omitted if they're not needed. So you'd never be forced to pass null params. E.g. see I'll clarify this in the doc though. And the current doc is just a rough outline of the API, but the final/proper API docs will definitely specify precisely which options are needed vs. which are optional. =) |
I've only ever tested it where Oboe is making the request. That works. Not sure about anything else.
The transaction stream is synchronous. Streams per statement are asynchronous, which is what your documentation appears to be referring to. https://github.com/brian-gates/cypher-stream#stream-per-statement
Oh, ignore me, that's just CoffeeScript throwing me for a loop :) |
Cool, thanks. I won't worry about Oboe in the browser then. Non-"mainline" scenario aside, there's also nothing fundamentally limiting; it should always be theoretically possible to still stream the JSON parsing even if you're not the one making the HTTP request. Great point about statement streams. Any reason though that a stream couldn't be returned immediately, and "wired up" under the hood later whenever the underlying CypherStream is emitted? (This assumes that we'd provide our own wrapper stream rather than the underlying CypherStream directly, but I think that's probably a wise API thing to do anyway. Or maybe we document that we're returning a CypherStream directly, and we just proxy all events, etc.) Thanks for all the great feedback again! |
The streams API prevents me from returning anything synchronously from my write. That said, I was planning on adding support for accepting a stream to pipe to as an alternative to callbacks. This would allow your library to generate and return a proxy stream immediately: var stream = new require('stream').PassThrough(); // or you could use highland.
cypher({ statement: statement, pipe: stream });
return stream; |
Nice. An API like that would be great. Thanks Brian. |
5bd2994
to
3eeec0e
Compare
7e9efbc
to
39f87de
Compare
8ba035a
to
f329d50
Compare
This reverts commit ed15bf4. It’s probably better to be honest/transparent.
I'm all with @gasi ! We've been using this in prod for a while too. |
Fixes #143.
API docs: https://github.com/thingdom/node-neo4j/blob/v2/API_v2.md
Core:
GraphDatabase
class, incl. w/ custom options (e.g. proxy, agent, etc.)Node
&Relationship
classes; parsing responsesError
classes; best error reporting ever (fixes Formalize errors, esp. client vs. server #73)Cypher:
Transaction
s (fixes Expose transactional Cypher feature #111) + helpful state trackingSchema management:
Legacy indexing(punted)Advanced:
Cypher streaming (issue Add EventEmitter/streaming support in the API #50)(punted)async
/await
)Testing:
Documentation: