var jschan = require('jschan');
var session = jschan.memorySession();
var chan = session.createWriteChannel();
var ret = chan.createReadChannel();
chan.write( { hello: 'world, ret: ret } );
However it will be much simpler to have:
var jschan = require('jschan');
var session = jschan.memorySession();
var chan = session.writeChannel(); // shorter
var ret = jschan.readChannel(); // simpler, channels are derived from the top-level objects, and then passed through.
chan.write( { hello: 'world, ret: ret } );
I think this is not needed anymore, due to the fact that we can always create a memorySession() and create channels from there, and these will be auto-piped when passed through other sessions.
Currently to create a return channel we use:
However it will be much simpler to have: