Skip to main content

Input

Inputs: i1...iN defined by numPorts
Outputs: o1...oN defined by numPorts

The Input operator is used to ensure that only messages with increasing timestamp are sent to the rest of the program.

In certain scenarios data received from the outside world may arrive not time-ordered, or messages with same timestamp might be received consecutively. In such scenarios the Input operator will discard invalid messages to ensure the proper functioning of the operator pipeline behind it. The Input operator does not hold a message buffer on any of the ports defined, so it forwards the received message on the port ik through the port ok right after.

1kN1 \leq k \leq N

The received messages are not buffered therefore it has a little footprint on the calculation process.

Parameters

id: The id of the operator

numPorts: The number of possible input ports. Useful if more than one input is taken. Default value: 1. Minimum value: 1.

Usage

import { Program, Input } from "@rtbot-dev/rtbot";

const id = "id";
const numPorts = 20;

const program = new Program();
program.addOperator(new Input(id, numPorts));