GithubHelp home page GithubHelp logo

ready-callback's Issues

isWeakDep 与 timeout 语义

ready-callback 被广泛应用于控制 app 和 agent 启动。

有时候我们会添加一些弱依赖

const done = app.readyCallback('init xx', { isWeakDep: true, timeout: 3000 });
xx.ready(done);

我们写这段代码的时候,设想的是弱依赖的启动控制项不会影响初始化。

但实际上,如果 xx 启动不成功,在出错或者超时的时候必须 done(err),app 才会继续启动。

isWeakDep 目前的语义是或略 done 传过来的 err,继续去 ready,但是前提是 done 还是被调用一次。

这个地方很多 plugin 都踩坑了,也就是说我们以为的弱依赖都变成了强依赖(因为没有保证一定 done)。

@popomore 是否要改进一下 ready-callback,变成 timeout 之后就继续 ready 并不再等 done 被调用.

docs typo

Remove -g flag in the npm install command of the Installation section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.