Hey all,
I’ve been working on a Node.js implementation of the TCP interface, and it’s far enough along to share (I’m using it in a prototype to great success, but not in production yet).
Project is at https://github.com/kenpratt/nodejs-EventStore. See https://github.com/kenpratt/nodejs-EventStore/blob/master/examples/basic.js for an example.
It currently implements:
-
CreateStream
-
WriteEvents
-
ReadStreamEventsForward
-
SubscribeToStream
-
Heartbeat
As well as a couple of higher-level helpers:
-
ReadStream - like ReadStreamEventsForward, but a bit friendlier.
-
ReadAndSubscribeToStream - reads all the events in the stream, subscribes to the stream, and calls your callback for each existing and new event, making sure you don’t get any duplicates.
Comments & feedback welcome, and contributions encouraged. If Event Store wants to take over the project, I’m totally fine with that too
Thanks!
-Ken
PS. I had to make a few changes to the protocol buffers file to get this working – it appears that some of the output from the TCP API doesn’t match the spec quite right and protobufs choked when decoding the packets:
EventLinkPair: changed link from required to optional
CreateStreamCompleted: changed error from required to optional
WriteEventsCompleted: changed error from required to optional