Core
Write Protocols v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

init #

Initializes the protocol.

Called once, during Kuzzle startup.


Arguments #

init(entryPoint, context);

ArgumentsTypeDescription
entryPointEntryPointProvides an interface to protocol related methods
contextcontextGeneric interface exposing objects and methods not directly related to the network layer

Return #

The init function can optionally return a promise. If it does, Kuzzle waits for the promise to be resolved before continuing its own initialization.

If a promise is returned, it must be resolved within the configured timeout (see services.common.defaultInitTimeout in Kuzzle's configuration)

If a promise is returned and rejected, or if the init function throws an error, Kuzzle aborts its start sequence and shuts down.