commit | 4aa53f30aea967d4d326a0383bb19764dcf687dd | [log] [tgz] |
---|---|---|
author | Suharsh Sivakumar <suharshs@google.com> | Sat Feb 06 01:25:23 2016 -0800 |
committer | Suharsh Sivakumar <suharshs@google.com> | Sat Feb 06 01:25:23 2016 -0800 |
tree | 3f89ba6e3d71fdccb0a53a773c498e431d0056e5 | |
parent | 12976a5c835f81d4caa91b778c4aacff6f9d3fa3 [diff] |
js.core: Introduce options.ConnectionTimeout and remove options.RetryTimeout. There were a few subleties during implementation: (1) We needed to introduce flow.Manager.DialCached to ensure that ConnectionTimeout == 0 means "only use a cached conn". (2) To implement flow.Manager.DialCached, we need to introduce conncache.FindWithRoutingID to ensure that we only return connection to end servers when a rid is present, instead of a connection to an intermediate proxy which is what would happen if we proceeded with the network lookup. (3) When retrying connection establishment, ConnectionTimeout == 0 must also imply options.NoRetry, otherwise we will unnecessarily retry a connection establishment that is not in the cache. This is not true for verror.RetryBackoff errors (errors returned from applications) since they may be requesting a retry for arbritrary reasons. Change-Id: I1a5acf5e3b0fdccf511724de394f283357db53fd MultiPart: 3/3
This repository defines the JavaScript API for Vanadium. The client and server APIs defined here work both in Node.js and the browser.
npm install --save vanadium/js
The entry point to the API is through a module called vanadium
, everything else is considered private and should not be accessed by the users of the API.
The vanadium
module is exported as a global in the browser JavaScript library and for Browserify and Node.js the “main” property in the package.json
points to /src/vanadium
making it the index module and therefore Browserify and Node.js users can gain access to the API with:
var vanadium = require("vanadium");
One of the goals of this project is to only write the code once and have it run in both Node.js and browsers. Therefore, specific build and testing steps have been designed in the project to ensure this goal.
When run in a browser, vanadium.js
expects that the vanadium extension will be installed.
Bugs and feature requests should be filed in the Vanadium issue tracker.
GNU Make is used to build and test Vanadium.
Build everything:
make build
Test everything:
make test
Run a specific test suite:
make test-unit make test-unit-node make test-unit-browser make test-integration make test-integration-node make test-integration-browser
Remove all build and testing artifacts:
make clean