initSync

Warning

This is a convenience function provided for quick debugging/prototyping if you don’t have top-level await available. init will initialize one second faster.

initSync(url = 'https://scheduler.distributed.computer', autoUpdate = false[, bundleLocation])

Synchronously initialize the dcp-client bundle for use by the compute API, etc.

Arguments
  • url (string|URL()) – Scheduler URL location, defaults to https://scheduler.distributed.computer. Should never need to be changed except by internal devs or those with seperate schedulers.

  • autoUpdate (boolean()) – Automatically update the dcp-client bundle, defaults to true. Disable to keep tight dependency control.

  • bundleLocation (string()) – Bundle location to download during auto updating. Defaults to most up to date dcp-client bundle, only change if a particular dcp-client version is strictly required.

Return type

An instance of a DCP object.

Example:

const { initSync } = require('dcp-client');

const dcp = initSync();

/* DCP App ... */