Comparing version 9.2.3 to 9.2.4
@@ -64,2 +64,4 @@ let Cerobee = require('clerobee') | ||
shifted: async function ( state, target = '*' ) { | ||
if (this.entangled) | ||
await this.inform( this.entangled + '.shifted', state, target ) | ||
let object = { division: self.division, context: self.context, name: self.name, state: state, target: target, notifyTos: this.notifyTos } | ||
@@ -66,0 +68,0 @@ return self.ignite( Communication.MODE_INFORM, null, null, self.barrel.systemFirestarter.division, self.barrel.systemFirestarter.name + '.' + 'entityShifted', object ) |
{ | ||
"name": "harcon", | ||
"version": "9.2.3", | ||
"version": "9.2.4", | ||
"description": "Messaging/Service Bus for the harmonic convergence of node-based enterprise entities.", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"clerobee": "^0.9.8", | ||
"cron": "^1.7.0", | ||
"cron": "^1.7.1", | ||
"harcon-flow": "^2.7.0", | ||
@@ -32,3 +32,3 @@ "isa.js": "^2.2.10", | ||
"proback.js": "^2.1.8", | ||
"vindication.js": "^4.14.10" | ||
"vindication.js": "^4.14.20" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
"pino": "~5", | ||
"pino-pretty": "~2", | ||
"pino-pretty": "~3", | ||
"secp256k1": "^3.6.2", | ||
@@ -42,0 +42,0 @@ "zipkin": "^0.17.1" |
@@ -838,4 +838,17 @@ Harcon - Proven and reliable microservice solution for the harmonic convergence of JS entities. | ||
#### Entity entangling | ||
Entangling is a feature to keep state shifting in sync between distant entities. Lets consider the following entity: | ||
``` | ||
module.exports = { | ||
name: 'Marie', | ||
context: 'greet', | ||
entangled: 'Marion', | ||
... | ||
``` | ||
In the code above, entity __Marie__ is entangled to __Marion__ which makes the [harcon](https://github.com/imrefazekas/harcon) to sync all state changes of __Marie__ to __Marion__ through the bus. That will _"force"_ __Marion__ to be the subject of the same state shifting occurred in __Marie__. Such feature could be useful when really distant enties must replicate state changes in a transparent and automated way. | ||
## Interoperating with other harcon instances | ||
@@ -1031,3 +1044,22 @@ | ||
Of course it might happen you need a manual work to save an incoming communication and save the terms object and initiate a communication later in tame as a continuation of the give flow. Please read the following code: | ||
```javascript | ||
let ManCanDo = { | ||
auditor: true, | ||
startToWork: async function ( terms ) { | ||
let comm = this.burst( terms.sourceComm, terms, '', 'ManCanDo.whatever' ) | ||
// save the comm | ||
return 'ok' | ||
}, | ||
returnToWork: async function( document ) { | ||
let comm = retrieveComm( ... ) | ||
// 'ManCanDo.whatever' will be performed as a next execution point in the flow ... | ||
this.blow( comm ) | ||
} | ||
} | ||
``` | ||
## Live-reload entities | ||
@@ -1034,0 +1066,0 @@ |
module.exports = { | ||
name: 'Lina', | ||
init: async function (options) { | ||
// console.log('Init...', options) | ||
// console.log('Init_NEW...', options) | ||
return 'ok' | ||
@@ -10,3 +10,10 @@ }, | ||
return 'OK' | ||
}, | ||
marionChanged: async function ( payload ) { | ||
this.hasMarionChanged = true | ||
return 'OK' | ||
}, | ||
flying: async function ( ) { | ||
return 'Flying in the clouds...' | ||
} | ||
} |
module.exports = { | ||
name: 'Marie', | ||
context: 'greet', | ||
entangled: 'Marion', | ||
init: async function (options) { | ||
@@ -5,0 +6,0 @@ // console.log('Init...', this.name, this.division, options) |
@@ -63,3 +63,3 @@ const assert = require('assert') | ||
}) | ||
/* | ||
describe('Test Harcon system calls', function () { | ||
@@ -108,3 +108,3 @@ it('Retrieve divisions...', async function () { | ||
}) | ||
*/ | ||
describe('simple messages', function () { | ||
@@ -133,3 +133,3 @@ it('Alize dormir', async function () { | ||
}) | ||
/* | ||
describe('Harcon broadcasting', function () { | ||
@@ -175,2 +175,14 @@ it('Broatcasting', async function () { | ||
}) | ||
it('Entangled case', async function () { | ||
let Lina = inflicter.barrel.firestarter('Lina').object | ||
await inflicter.request( clerobee.generate(), null, '', 'Marion.notify', 'data', '', 'Lina.marionChanged') | ||
await Proback.timeout( 250 ) | ||
await inflicter.request( clerobee.generate(), null, '', 'Marie.simple', 'Bonjour', 'Salut' ) | ||
await Proback.timeout( 250 ) | ||
await Proback.until( function () { | ||
return Lina.hasMarionChanged | ||
}, 250 ) | ||
}) | ||
}) | ||
@@ -326,3 +338,3 @@ | ||
}) | ||
*/ | ||
after(async function () { | ||
@@ -329,0 +341,0 @@ if (inflicter) { |
@@ -11,2 +11,6 @@ module.exports = { | ||
}, | ||
marionChanged: async function ( payload ) { | ||
this.hasMarionChanged = true | ||
return 'OK' | ||
}, | ||
flying: async function ( ) { | ||
@@ -13,0 +17,0 @@ return 'Flying in the clouds...' |
@@ -10,3 +10,7 @@ module.exports = { | ||
return 'OK' | ||
}, | ||
marionChanged: async function ( payload ) { | ||
this.hasMarionChanged = true | ||
return 'OK' | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
649985
4256
1157
Updatedcron@^1.7.1
Updatedvindication.js@^4.14.20