mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
moved from direct IPC to peer archetecture, still playing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ab72b0d6f2
commit
4b32f370ba
@ -1,40 +0,0 @@
|
|||||||
/**********************************************************************
|
|
||||||
*
|
|
||||||
* Setup a node.js child_process communications channel and listen and
|
|
||||||
* exec commands...
|
|
||||||
*
|
|
||||||
*
|
|
||||||
**********************************************************************/
|
|
||||||
((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)
|
|
||||||
(function(require){ var module={} // make module AMD/node compatible...
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
var actions = require('lib/actions')
|
|
||||||
var features = require('lib/features')
|
|
||||||
|
|
||||||
var core = require('features/core')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
var ChildActions = actions.Actions({
|
|
||||||
})
|
|
||||||
|
|
||||||
var Child =
|
|
||||||
module.Child = core.ImageGridFeatures.Feature({
|
|
||||||
title: '',
|
|
||||||
doc: '',
|
|
||||||
|
|
||||||
tag: 'child',
|
|
||||||
|
|
||||||
isApplicable: function(){
|
|
||||||
return this.runtime == 'nw' || this.runtime == 'node' },
|
|
||||||
|
|
||||||
actions: ChildActions,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
|
||||||
* vim:set ts=4 sw=4 : */ return module })
|
|
||||||
106
ui (gen4)/features/peer.js
Executable file
106
ui (gen4)/features/peer.js
Executable file
@ -0,0 +1,106 @@
|
|||||||
|
/**********************************************************************
|
||||||
|
*
|
||||||
|
* Setup a node.js child_process communications channel and listen and
|
||||||
|
* exec commands...
|
||||||
|
*
|
||||||
|
*
|
||||||
|
**********************************************************************/
|
||||||
|
((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)
|
||||||
|
(function(require){ var module={} // make module AMD/node compatible...
|
||||||
|
/*********************************************************************/
|
||||||
|
|
||||||
|
var actions = require('lib/actions')
|
||||||
|
var features = require('lib/features')
|
||||||
|
|
||||||
|
var core = require('features/core')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************************************************/
|
||||||
|
|
||||||
|
// XXX this is a generic API, add ability to define protocols...
|
||||||
|
// Protocols:
|
||||||
|
// - child_process
|
||||||
|
// - http
|
||||||
|
// - rpc/mq
|
||||||
|
var PeerActions = actions.Actions({
|
||||||
|
|
||||||
|
// XXX need more control...
|
||||||
|
// - get proxies to specific peer...
|
||||||
|
get peeractions(){
|
||||||
|
return this.getPeerActions() },
|
||||||
|
|
||||||
|
getPeerActions: ['- Peer/',
|
||||||
|
function(id){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
|
||||||
|
peerCreate: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
peerConnect: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
|
||||||
|
// event...
|
||||||
|
peerConnected: ['- Peer/',
|
||||||
|
core.notUserCallable(function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
// event...
|
||||||
|
peerDisconnected: ['- Peer/',
|
||||||
|
core.notUserCallable(function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
|
||||||
|
peerList: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
peerSpec: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
peerProxy: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
|
||||||
|
peerCall: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
peerApply: ['- Peer/',
|
||||||
|
function(){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
|
||||||
|
// XXX if no actions are given, proxy all...
|
||||||
|
// XXX also proxy descriptors???
|
||||||
|
peerMixin: ['- Peer/',
|
||||||
|
function(id, actions){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
// XXX should this be .peerMixout(..)
|
||||||
|
peerMixout: ['- Peer/',
|
||||||
|
function(id, actions){
|
||||||
|
// XXX
|
||||||
|
}],
|
||||||
|
})
|
||||||
|
|
||||||
|
var Peer =
|
||||||
|
module.Peer = core.ImageGridFeatures.Feature({
|
||||||
|
title: '',
|
||||||
|
doc: '',
|
||||||
|
|
||||||
|
tag: 'child',
|
||||||
|
|
||||||
|
actions: PeerActions,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* vim:set ts=4 sw=4 : */ return module })
|
||||||
Loading…
x
Reference in New Issue
Block a user