API

API

您所查看的文档没有与当前语言匹配的版本,因此我们将显示默认语言的版本。

API

The API reference covers the @fbpx/flow runtime — the engine that executes FBPX flows. It documents the core data structures that make up a running graph.

  • Node — defining node functionality
  • Port — input and output ports, the port schema, and port events
  • Packet — the unit of data that flows through a graph
  • Link — connections between nodes
  • Flow — the runtime representation of a graph
  • Streaming — streaming nodes that run once per packet

The runtime is available from npm as @fbpx/flow:

const {Flow, Link, Packet, InputPort, OutputPort} = require('@fbpx/flow')

Where things live

  • @fbpx/flow — the runtime: flows, nodes, ports, links, packets, and the streaming loop.
  • @fbpx/common — the shared data model (Flow, Node, Link, IIP, Provider, Port, …) and the JSON schemas generated from it. Most cross-package type imports come from here.
  • @fbpx/loader, @fbpx/loader-fs, @fbpx/loader-npm, @fbpx/loader-remote — resolve node definitions from local files, npm packages, or remote registries, driven by the provider line in a flow.
  • @fbpx/fbpx — the .fbp parser that turns a flow file into the data model.

The language, the runtime

There are two views of the same program:

  • The language section documents the .fbp syntax — nodes, links, IIPs, streams, providers — as you write it in a file.
  • This API section documents the runtime — the objects a running graph is made of.

A .fbp file is parsed by @fbpx/fbpx into the model that @fbpx/flow executes. The data model classes here are the same ones the parser produces and the runtime consumes.

编辑本页内容