First Commit of new way of building the Platform
This commit is contained in:
1 parent
e48cf0dae5
commit
40e60b42cc
4616 files changed
+713402
No files matched your search
Generated
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'goodbye';
|
||||
ipc.config.retry= 1500;
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
function(){
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function(){
|
||||
ipc.log('## connected to world ##', ipc.config.delay);
|
||||
ipc.of.world.emit(
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : 'goodbye'
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'disconnect',
|
||||
function(){
|
||||
ipc.log('disconnected from world');
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'kill.connection',
|
||||
function(data){
|
||||
ipc.log('world requested kill.connection');
|
||||
ipc.disconnect('world');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
Generated
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'hello';
|
||||
ipc.config.retry= 1500;
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
function(){
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function(){
|
||||
ipc.log('## connected to world ##', ipc.config.delay);
|
||||
ipc.of.world.emit(
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : 'hello'
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'disconnect',
|
||||
function(){
|
||||
ipc.log('disconnected from world');
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'app.message',
|
||||
function(data){
|
||||
ipc.log('got a message from world : ', data);
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'kill.connection',
|
||||
function(data){
|
||||
ipc.log('world requested kill.connection');
|
||||
ipc.disconnect('world');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
Generated
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'world';
|
||||
ipc.config.retry= 1500;
|
||||
|
||||
var messages={
|
||||
goodbye:false,
|
||||
hello:false
|
||||
};
|
||||
|
||||
ipc.serve(
|
||||
function(){
|
||||
ipc.server.on(
|
||||
'app.message',
|
||||
function(data,socket){
|
||||
ipc.log('got a message from', (data.id), (data.message));
|
||||
messages[data.id]=true;
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : data.message+' world!'
|
||||
}
|
||||
);
|
||||
|
||||
if(messages.hello && messages.goodbye){
|
||||
ipc.log('got all required events, telling clients to kill connection');
|
||||
ipc.server.broadcast(
|
||||
'kill.connection',
|
||||
{
|
||||
id:ipc.config.id
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
ipc.server.start();
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'hello';
|
||||
ipc.config.retry = 1000;
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
function(){
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function(){
|
||||
ipc.log('## connected to world ##', ipc.config.delay);
|
||||
ipc.of.world.emit(
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : 'hello'
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'disconnect',
|
||||
function(){
|
||||
ipc.log('disconnected from world');
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'app.message',
|
||||
function(data){
|
||||
ipc.log('got a message from world : ', data);
|
||||
}
|
||||
);
|
||||
|
||||
console.log(ipc.of.world.destroy);
|
||||
}
|
||||
);
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'world';
|
||||
ipc.config.retry= 1500;
|
||||
|
||||
ipc.serve(
|
||||
function(){
|
||||
ipc.server.on(
|
||||
'app.message',
|
||||
function(data,socket){
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : data.message+' world!'
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
ipc.server.start();
|
||||
Generated
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'hello';
|
||||
ipc.config.retry = 1000;
|
||||
ipc.config.sync= true;
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
function(){
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function(){
|
||||
ipc.log('## connected to world ##', ipc.config.delay);
|
||||
|
||||
//queue up a bunch of requests to be sent synchronously
|
||||
for(var i=0; i<10; i++){
|
||||
ipc.of.world.emit(
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : 'hello'+i
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'disconnect',
|
||||
function(){
|
||||
ipc.log('disconnected from world');
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
'app.message',
|
||||
function(data){
|
||||
ipc.log('got a message from world : ', data);
|
||||
}
|
||||
);
|
||||
|
||||
console.log(ipc.of.world.destroy);
|
||||
}
|
||||
);
|
||||
Generated
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'world';
|
||||
ipc.config.retry= 1500;
|
||||
ipc.config.sync= true;
|
||||
|
||||
ipc.serve(
|
||||
function(){
|
||||
ipc.server.on(
|
||||
'app.message',
|
||||
function(data,socket){
|
||||
setTimeout(
|
||||
function(){
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
'app.message',
|
||||
{
|
||||
id : ipc.config.id,
|
||||
message : data.message+' world!'
|
||||
}
|
||||
);
|
||||
},
|
||||
2000
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
ipc.server.start();
|
||||
Generated
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'hello';
|
||||
ipc.config.retry= 1500;
|
||||
ipc.config.rawBuffer=true;
|
||||
ipc.config.encoding='ascii';
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
function(){
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function(){
|
||||
ipc.log('## connected to world ##', ipc.config.delay);
|
||||
ipc.of.world.emit(
|
||||
'hello'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
ipc.of.world.on(
|
||||
'data',
|
||||
function(data){
|
||||
ipc.log('got a message from world : ', data,data.toString());
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
Generated
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
const ipc=require('../../../node-ipc');
|
||||
|
||||
/***************************************\
|
||||
*
|
||||
* You should start both hello and world
|
||||
* then you will see them communicating.
|
||||
*
|
||||
* *************************************/
|
||||
|
||||
ipc.config.id = 'world';
|
||||
ipc.config.retry= 1500;
|
||||
ipc.config.rawBuffer=true;
|
||||
ipc.config.encoding='ascii';
|
||||
|
||||
ipc.serve(
|
||||
function(){
|
||||
ipc.server.on(
|
||||
'connect',
|
||||
function(socket){
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
'hello'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
ipc.server.on(
|
||||
'data',
|
||||
function(data,socket){
|
||||
ipc.log('got a message', data,data.toString());
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
'goodbye'
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
ipc.server.start();
|
||||
Reference in new issue
Block a user