Permalink
Browse files

Version 1.8.0. Loading indicator, and perform all joins in Mongo.

  • Loading branch information...
michaellperry committed Aug 21, 2016
1 parent dfda38d commit dc8076f8d5fd6e25547647d09a5ee5931650992e
View
@@ -0,0 +1,57 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Test",
+ "type": "node",
+ "request": "launch",
+ "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
+ "stopOnEntry": false,
+ "args": ["test/**/*.js", "--no-timeouts"],
+ "cwd": "${workspaceRoot}",
+ "runtimeExecutable": null,
+ "env": { "NODE_ENV": "testing"}
+ },
+ {
+ "name": "Launch",
+ "type": "node",
+ "request": "launch",
+ "program": "${workspaceRoot}/index.html",
+ "stopOnEntry": false,
+ "args": [],
+ "cwd": "${workspaceRoot}",
+ "preLaunchTask": null,
+ "runtimeExecutable": null,
+ "runtimeArgs": [
+ "--nolazy"
+ ],
+ "env": {
+ "NODE_ENV": "development"
+ },
+ "externalConsole": false,
+ "sourceMaps": false,
+ "outDir": null
+ },
+ {
+ "name": "Attach",
+ "type": "node",
+ "request": "attach",
+ "port": 5858,
+ "address": "localhost",
+ "restart": false,
+ "sourceMaps": false,
+ "outDir": null,
+ "localRoot": "${workspaceRoot}",
+ "remoteRoot": null
+ },
+ {
+ "name": "Attach to Process",
+ "type": "node",
+ "request": "attach",
+ "processId": "${command.PickProcess}",
+ "port": 5858,
+ "sourceMaps": false,
+ "outDir": null
+ }
+ ]
+}
View
@@ -22,11 +22,8 @@ Each time you pull:
As you work:
-- Run "grunt typescript" to compile
-- Run "grunt mochaTest" to run the tests
-- Run "grunt" to start the watcher that will compile and run tests
-
-If you see test failures, that's exactly where I need some help!
+- Run "grunt" to compile and run the tests
+- Run "grunt watch" to start the watcher that will compile and run tests
## Testing
View
@@ -0,0 +1,2 @@
+window.Jinaga = require("./jinaga");
+window.JinagaDistributor = require("./jinaga.distributor.client");
View
@@ -1,6 +1,6 @@
{
"name": "jinaga",
- "version": "1.7.6",
+ "version": "1.8.0",
"description": "Universal Web Backend",
"main": "jinaga.js",
"repository": {
@@ -22,7 +22,7 @@
"engine.io-client": "^1.5.2",
"keypair": "^1.0.0",
"minimist": "^1.2.0",
- "mongodb": "^2.0.43",
- "requirejs": "^2.1.20"
+ "mongodb": "^2.2.9",
+ "requirejs": "^2.3.1"
}
}
View
@@ -22,11 +22,11 @@
"devDependencies": {
"chai": "^3.2.0",
"grunt": "^0.4.5",
- "grunt-browserify": "^4.0.1",
- "grunt-contrib-watch": "^0.6.1",
+ "grunt-browserify": "^5.0.0",
+ "grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "^0.12.7",
"grunt-typescript": "^0.8.0",
- "mocha": "^2.2.5",
+ "mocha": "^3.0.2",
"typescript": "^1.8.10"
},
"dependencies": {
@@ -35,7 +35,7 @@
"engine.io-client": "^1.5.2",
"keypair": "^1.0.0",
"minimist": "^1.2.0",
- "mongodb": "^2.1.16",
- "requirejs": "^2.1.20"
+ "mongodb": "^2.2.9",
+ "requirejs": "^2.3.1"
}
}
View
@@ -47,7 +47,7 @@ class JinagaConnector implements NetworkProvider {
}
watch(start: Object, query: Query) {
- this.distributor.executeQuery(start, query, null, (error: string, results: Array<Object>) => {
+ this.distributor.executeParialQuery(start, query, null, (error: string, results: Array<Object>) => {
results.forEach((result: Object) => {
debug("Sending " + JSON.stringify(result));
this.coordinator.onReceived(result, null, this);
@@ -71,7 +71,7 @@ class JinagaConnector implements NetworkProvider {
}
query(start: Object, query: Query, token: number) {
- this.distributor.executeQuery(start, query, null, (error: string, results: Array<Object>) => {
+ this.distributor.executeParialQuery(start, query, null, (error: string, results: Array<Object>) => {
results.forEach((result: Object) => {
debug("Sending " + JSON.stringify(result));
this.coordinator.onReceived(result, null, this);
@@ -87,7 +87,7 @@ class JinagaConnector implements NetworkProvider {
distribute(fact: Object) {
this.watches.forEach((watch) => {
- this.distributor.executeQuery(fact, watch.affected, null, (error: string, affected: Array<Object>) => {
+ this.distributor.executeParialQuery(fact, watch.affected, null, (error: string, affected: Array<Object>) => {
if (error) {
debug(error);
return;
View
@@ -288,13 +288,23 @@ export interface StorageProvider {
dequeue(token: number, destination: any);
}
+export interface PersistenceProvider {
+ init(coordinator: Coordinator);
+ save(fact: Object, source: any);
+ executePartialQuery(
+ start: Object,
+ query: Query,
+ result: (error: string, facts: Array<Object>) => void
+ );
+}
+
export interface KeystoreProvider {
getUserFact(userIdentity: UserIdentity, done: (userFact: Object) => void);
}
export interface NetworkProvider {
init(coordinator: Coordinator);
- watch(start: Object, query: Query);
+ watch(start: Object, query: Query, token: number);
stopWatch(start: Object, query: Query);
query(start: Object, query: Query, token: number);
fact(fact: Object);
@@ -27,11 +27,12 @@ class JinagaDistributor implements NetworkProvider {
this.coordinator = coordinator;
}
- public watch(start: Object, query: Query) {
+ public watch(start: Object, query: Query, token: number) {
var watch = {
type: "watch",
start: start,
- query: query.toDescriptiveString()
+ query: query.toDescriptiveString(),
+ token: token
};
this.watches.push(JSON.stringify(watch));
this.send(JSON.stringify(watch));
Oops, something went wrong.

0 comments on commit dc8076f

Please sign in to comment.