diff options
author | kumavis <aaron@kumavis.me> | 2016-04-15 12:22:04 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2016-04-15 12:22:04 +0800 |
commit | 907e39e5abc301fa54e144c5c151b79c3affb788 (patch) | |
tree | fcefefc50d3bb7452e91e507b437805a48c9e929 /app/scripts/background.js | |
parent | cef1f2a65f27d594b12afd021dea73fcaf569af5 (diff) | |
download | tangerine-wallet-browser-907e39e5abc301fa54e144c5c151b79c3affb788.tar.gz tangerine-wallet-browser-907e39e5abc301fa54e144c5c151b79c3affb788.tar.zst tangerine-wallet-browser-907e39e5abc301fa54e144c5c151b79c3affb788.zip |
wiring - move to obj-multiplex
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r-- | app/scripts/background.js | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js index a4f80d7f6..f3dd8cbb6 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -1,5 +1,5 @@ const Dnode = require('dnode') -const Multiplex = require('multiplex') +const ObjectMultiplex = require('./lib/obj-multiplex') const eos = require('end-of-stream') const combineStreams = require('pumpify') const extend = require('xtend') @@ -89,7 +89,7 @@ function onRpcRequest(remoteStream, payload){ function handleInternalCommunication(portStream){ // setup multiplexing - var mx = Multiplex() + var mx = ObjectMultiplex() portStream.pipe(mx).pipe(portStream) mx.on('error', function(err) { console.error(err) @@ -99,15 +99,8 @@ function handleInternalCommunication(portStream){ console.error(err) mx.destroy() }) - var dnodeStream = mx.createSharedStream('dnode') - var providerStream = combineStreams.obj( - jsonStringifyStream(), - mx.createSharedStream('provider'), - jsonParseStream() - ) - - linkDnode(dnodeStream) - handleEthRpcRequestStream(providerStream) + linkDnode(mx.createStream('dnode')) + handleEthRpcRequestStream(mx.createStream('provider')) } function linkDnode(stream){ |