Skip to main content
Version: Next

Flows

SkyPath Web SDK represent features as flows to make it easier to use them.

Lifecycle ⏳

Basically, each flow is a loop that can be started then updated and stopped. It is done to control the order of actions performed for the feature to work.

Usage 🚀

To created the desired flow, simply call corresponding method from the SDK object that will return an instance of the flow.

note

You may have multiple instances of one flow if needed.

Follow the method naming template: create + flow naming + flow.

See examples:

const nowcastingFlow = sdk.createNowcastingFlow()
const observationsFlow = sdk.createObservationsFlow()

Every flow has 4 main methods:

  • flow.start() - Runs the flow, allocates resources, initiate intervals;
  • flow.stop() - Stops the flow, keeps resources, pauses intervals;
  • flow.terminate() - Cleans up the flow, removes intervals, releases all resources;
  • flow.updateConfig() - Updates the flow with a new configuration;
  • flow.onData() - Takes a callback function that will consume new data;
info

Each flow, defines its own structure of configuration object as well as the data structure returned from the onData method.

Available flows

Currently, several flows are available:

Don't see desired feature? Request it using our form.