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

  • autoUpdate (boolean()) – AutoUpdate dcp-client bundle, defaults to true.

  • bundleLocation (string()) – Bundle location to download during auto updating.

Return type

An instance of a DCP object.

Example usage

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

const dcp = initSync();

const compute = require('dcp/compute');
// or
// const { compute } = dcp;