Skip to content
Permalink
Browse files
small improvment
  • Loading branch information
hufeng committed Jun 27, 2018
1 parent 23bcae8 commit aadb4454a367d6286d245987e9ae7fd33908690f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
@@ -11,11 +11,11 @@ const dubbo = (module.exports = new Dubbo({
// console.log('dubbo was ready');
// });

dubbo.subscribe({
onTrace: msg => {
console.log(msg);
},
});
// dubbo.subscribe({
// onTrace: msg => {
// console.log(msg);
// },
// });

//cost middleware
/*dubbo.use(async function costTime(ctx, next) {
@@ -30,7 +30,8 @@ export const fromBytes4 = (buf: Buffer) => {

export const toBytes8 = (num: number) => {
const buf = Buffer.allocUnsafe(8);
const high = Math.floor(num / Math.pow(2, 32));
//2 ** 32 = 4294967296
const high = Math.floor(num / 4294967296);
const low = (num & 0xffffffff) >>> 0;
buf.writeUInt32BE(high, 0);
buf.writeUInt32BE(low, 4);
@@ -21,10 +21,10 @@ import zookeeper from 'node-zookeeper-client';
import qs from 'querystring';
import Context from './context';
import DubboUrl from './dubbo-url';
import {ZookeeperDisconnectedError, ZookeeperTimeoutError} from './err';
import {to} from './to';
import {IObservable, IZkClientProps, IZookeeperSubscriber} from './types';
import {isDevEnv, msg, noop, traceErr, traceInfo} from './util';
import { ZookeeperDisconnectedError, ZookeeperTimeoutError } from './err';
import { to } from './to';
import { IObservable, IZkClientProps, IZookeeperSubscriber } from './types';
import { isDevEnv, msg, noop, traceErr, traceInfo } from './util';

const log = debug('dubbo:zookeeper');
const ipAddress = ip.address();

0 comments on commit aadb445

Please sign in to comment.