-
Notifications
You must be signed in to change notification settings - Fork 149
Routing driver #141
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
Routing driver #141
Conversation
7494f97
to
78cabbd
Compare
59d8b03
to
822a438
Compare
2b392fd
to
69e5137
Compare
The connection pool now handles connections to multiple URI, this work is a precursor to handling multiple connections in the driver.
We need purging of item in the connection pool since we need a way of removing connections that are no longer online or in other ways have been removed from a cluster.
Updating to babel 6 required significant changes mostly on how we do export and import since babel 6 is more strict than babel 5.
Instead of keeping a connection `Session` and `Transaction` now keep a promise to a connection instead of a resolved connection.
Support routing on session acquistion.
69e5137
to
f3e3d01
Compare
5f52ccd
to
dc6ed54
Compare
6ae9fd3
to
e2a7d4b
Compare
e2a7d4b
to
ddeef04
Compare
bb614b9
to
0ce9982
Compare
If the response from `getServers` contains an empty `writers` list we should reject that answer and procede to the next available router.
index = this._items.indexOf(item, index); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively you could move the _index
manipulation logic into next
so that it does bounds checking and adjustment before using the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splice
does in-place rewrite of the array I want to be sure that the index is up-to-date after each removal in the loop
Support for routing operations in the js driver:
Usage:
By using the scheme
bolt+routing
the driver will ask the seed server to provide a view of the current cluster, which contains information on where to direct read requests, write requests and where to direct new routing requests. The driver maintains this information and will automatically spread the load among these servers. If servers go offline the driver will remove them and when running out of servers a new routing request will be performed to refresh the view of the cluster. The return from the routing request also contains attl
, when this time has expired the driver will also refresh the cluster view.On running requests two types of errors can happen:
SESSION_EXPIRED
: Means that the server is unable to perform the current action, the application should ask for a new session from the driver and retry the operation.SERVICE_UNAVAILABLE
: The driver has completely lost contact with the cluster, the driver needs to be recreated in order for any new operations to be possible.