dominictarr / rpc-stream

Other
98 stars 12 forks source link

docker rpc #18

Open vinnitu opened 9 years ago

vinnitu commented 9 years ago

[node.js script] <---> [dockerode create docker container] <---> [dockerfile has pyton script with RPC]

bind all with tty/stdio/stdout I use rpc-stream on host/nodejs/side and rpyc-stream on container/python side.

Totally I need duplex rpc in both sides. I mean client(nodejs) will be client and server at same time. Docker container(python) too.

But I don't understand it is possible with rpc-stream or not? Because used online one stream (stdout+stdin+stderr in one)

I can share my test Dockerfile if you want and maybe we can solve my problem?

juliangruber commented 9 years ago

rpc-stream can go both ways over one stream.

// client one
var server = rpc({ hello: function(cb){ cb(null, 'hello') }});
var client = rpc();
process.stdin.pipe(client).pipe(process.stdout);
// client two
var server = rpc({ hello: function(cb){ cb(null, 'hello') }});
var client = rpc();
process.stdin.pipe(client).pipe(process.stdout);