mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-02 11:54:01 +01:00
32 queue workers for dealing with shares. Primarily non-blocking. Lets see if this plays better.
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ function messageHandler(message) {
|
|||||||
break;
|
break;
|
||||||
case 'sendRemote':
|
case 'sendRemote':
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
global.database.sendQueue.push(Buffer.from(message.data, 'hex'));
|
global.database.sendQueue.push({body: Buffer.from(message.body, 'hex')});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'trustedShare':
|
case 'trustedShare':
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ function Database() {
|
|||||||
function () {
|
function () {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}, 128);
|
}, require('os').cpus().length*32);
|
||||||
|
|
||||||
this.storeShare = function (blockId, shareData) {
|
this.storeShare = function (blockId, shareData) {
|
||||||
let wsData = global.protos.WSData.encode({
|
let wsData = global.protos.WSData.encode({
|
||||||
@@ -55,7 +55,7 @@ function Database() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
setInterval(function(queue_obj){
|
setInterval(function(queue_obj){
|
||||||
if (thread_id === '(Master) '){
|
if (global.database.thread_id === '(Master) '){
|
||||||
console.log(global.database.thread_id + "Queue debug state: " + queue_obj.length() + " items in the queue " + queue_obj.running() + " items being processed");
|
console.log(global.database.thread_id + "Queue debug state: " + queue_obj.length() + " items in the queue " + queue_obj.running() + " items being processed");
|
||||||
}
|
}
|
||||||
}, 5000, this.sendQueue);
|
}, 5000, this.sendQueue);
|
||||||
|
|||||||
Reference in New Issue
Block a user