ready-callback
Advanced tools
Comparing version 2.0.1 to 2.1.0
2.1.0 / 2018-08-21 | ||
================== | ||
**features** | ||
* [[`37bd48f`](http://github.com/node-modules/ready-callback/commit/37bd48fe923982169d98f402a8e6bf3e5c7efc8a)] - feat: add lazyStart option (#113) (killa <<killa123@126.com>>) | ||
2.0.1 / 2017-02-13 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -24,2 +24,3 @@ 'use strict'; | ||
* - {Boolean} [isWeakDep=false] - whether it's a weak dependency | ||
* - {Boolean} [lazyStart=false] - will not check cache size automatically, if lazyStart is true | ||
*/ | ||
@@ -34,2 +35,8 @@ constructor(opt) { | ||
if (!this.opt.lazyStart) { | ||
this.start(); | ||
} | ||
} | ||
start() { | ||
setImmediate(() => { | ||
@@ -36,0 +43,0 @@ // fire callback directly when no registered ready callback |
{ | ||
"name": "ready-callback", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Launch server after all async task ready", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"autod": "^2.7.1", | ||
"egg-bin": "^2.0.2", | ||
"egg-bin": "^1.11.1", | ||
"egg-ci": "^1.1.0", | ||
@@ -29,2 +29,3 @@ "eslint": "^3.15.0", | ||
"koa": "^1.2.4", | ||
"mz-modules": "^2.1.0", | ||
"spy": "^1.0.0" | ||
@@ -31,0 +32,0 @@ }, |
@@ -134,4 +134,19 @@ # ready-callback | ||
### lazyStart | ||
You can set a ready-callback object to lazyStart. It will not check | ||
ready status immediately, and should start manualy to check ready | ||
status. | ||
```js | ||
var ready = require('ready-callback')({ lazyStart: true }); | ||
yield sleep(1); | ||
// ready obj is not ready | ||
ready.start(); | ||
yield sleep(1); | ||
// ready obj is ready now | ||
``` | ||
## LISENCE | ||
Copyright (c) 2015 popomore. Licensed under the MIT license. |
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
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
9459
128
152
8