process-custodian
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -6,11 +6,21 @@ 'use strict'; | ||
}); | ||
exports.humanize = exports.getFingerprint = exports.init = undefined; | ||
exports.humanize = exports.getFingerprint = exports.ProcessCustodian = undefined; | ||
var _fingerprint = require('./lib/fingerprint'); | ||
var _mongoStorage = require('./lib/mongoStorage'); | ||
var _ProcessCustodian = require('./lib/ProcessCustodian'); | ||
exports.init = _mongoStorage.init; | ||
var _ProcessCustodian2 = _interopRequireDefault(_ProcessCustodian); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.ProcessCustodian = _ProcessCustodian2.default; | ||
exports.getFingerprint = _fingerprint.getFingerprint; | ||
exports.humanize = _fingerprint.humanize; | ||
exports.default = _mongoStorage.init; | ||
_ProcessCustodian2.default.ProcessCustodian = _ProcessCustodian2.default; | ||
_ProcessCustodian2.default.getFingerprint = _fingerprint.getFingerprint; | ||
_ProcessCustodian2.default.humanize = _fingerprint.humanize; | ||
exports.default = _ProcessCustodian2.default; |
{ | ||
"name": "process-custodian", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "This package helps with organizing of tasks between few instances of same app, It can identify processes and track them activity.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,3 +18,3 @@ # Process Custodian | ||
After running `init` function, this package saves a heartbeat of process | ||
After create new instance of `ProcessCustodian`, this package saves a heartbeat of process | ||
to the passed raw mongodb collection with frequency about `tickTimeInSeconds` (which default is 60s) | ||
@@ -29,3 +29,3 @@ | ||
```#js | ||
import init from 'process-custodian'; | ||
import ProcessCustodian from 'process-custodian'; | ||
import {MongoClient} from 'mongodb' | ||
@@ -38,5 +38,5 @@ | ||
const handle = init({rawCollection: collection, tickTimeInSeconds: 60}); | ||
const handle = new ProcessCustodian({rawCollection: collection, tickTimeInSeconds: 60}); | ||
handle.onTick(() => { | ||
const stopOnTick = handle.onTick(() => { | ||
console.log('tick', handle.isMaster() ? 'master': 'slave') | ||
@@ -58,7 +58,7 @@ }); | ||
```#js | ||
import init from 'process-custodian'; | ||
import ProcessCustodian from 'process-custodian'; | ||
// for meteor: | ||
const collection = new Mongo.Collection('process_custodian'); | ||
const handle = init({ | ||
const handle = new ProcessCustodian({ | ||
rawCollection: collection.rawCollection(), | ||
@@ -68,5 +68,5 @@ tickTimeInSeconds: 60 | ||
handle.onTick(() => { | ||
handle.onceTick(() => { | ||
console.log('tick', handle.isMaster() ? 'master': 'slave') | ||
}); | ||
}); | ||
@@ -89,3 +89,3 @@ handle.onIAmNewMaster(() => { | ||
``` | ||
import init, {getFingerprint, humanize} from 'process-custodian'; | ||
import {getFingerprint, humanize} from 'process-custodian'; | ||
@@ -92,0 +92,0 @@ //Getting fingerprint |
import {getFingerprint, humanize} from './lib/fingerprint'; | ||
import {init} from './lib/mongoStorage'; | ||
import ProcessCustodian from './lib/ProcessCustodian'; | ||
export { | ||
init, | ||
ProcessCustodian, | ||
getFingerprint, | ||
@@ -11,2 +11,6 @@ humanize | ||
export default init; | ||
ProcessCustodian.ProcessCustodian = ProcessCustodian; | ||
ProcessCustodian.getFingerprint = getFingerprint; | ||
ProcessCustodian.humanize = humanize; | ||
export default ProcessCustodian; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28794
587
1