Skip to content

Commit

Permalink
adding adapters groups
Browse files Browse the repository at this point in the history
  • Loading branch information
salboaie committed Dec 10, 2012
1 parent 6f5dd97 commit ac92192
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
4 changes: 3 additions & 1 deletion adaptors/Null.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* Dummy adapter, used in tests
*/
require('swarmutil').createAdapter("Null*");
require('swarmutil').createAdapter("Null*",null, function(swarm){
cprint("Null* ignored swarm message "+ M(swarm));
}, false);



38 changes: 20 additions & 18 deletions adaptors/SessionManager.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
/*
How sessions are handled in swarmESB:
SessionId
responseURI
actor:id
SessionManager configuration
- uuid
- maxSessions
session
TCPOutlet
SessionInfo:
sessionId
userId
tenantId
pendingCmds
isClosed
WebSocketOutlet
SessionId
responseURI: uuid of the entry adapter
clientSwarmletId
WebServiceOutlet
session
JSONOutlet
WebSocketOutlet
WebServiceOutlet
*/

var uuid = require('node-uuid');
var workerId = "worker:" + uuid.v4();
thisAdapter = require('swarmutil').createAdapter(workerId,null);

require('swarmutil').createAdapter(workerId,onReadyCallback);

function onReadyCallback(){


}


doWork = function(){
//do something
}
thisAdapter.join("@SessionManager");
6 changes: 5 additions & 1 deletion adaptors/SocketIOAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
*/
var sutil = require('swarmutil');

thisAdapter = sutil.createAdapter("SIOClientAdapter", null, null, false);

thisAdapter = sutil.createAdapter("SIOClientAdapter", null, function(swarm){
sendToSocket(swarm);
}, false);

//thisAdapter.loginSwarmingName = "login.js";
//globalVerbosity = true;

Expand Down

0 comments on commit ac92192

Please sign in to comment.