Skip to content

Asynchronous initialisation process #32

Description

@daankets

Due to the current implementation of the boot process using this invocation style:

javascript
module.exports = function someBootScript(app) {
  // Init models, ...
  // Setup relationships
  // Other async stuff
};

it is currently not really possible (in a clean way) to have loopback wait with accepting requests until complete finalisation of the boot process. Some asynchronous operations may not yet have finished.

Please adjust this to something like:

module.exports = function someAsyncBootScript(app, done) {
  // Init models, ...
  // Setup relationships
  // Other async stuff that calls done() when ready.
};

And only start the listener after this... It should be fairly easy to implement this using Q.all()...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions