TablePublisher

The TablePublisher class creates a blink table from tables that are added to it via the add method.

Syntax

Parameters

ParameterTypeDescription
nameString

The name of the table publisher.

definitionTableDefinition

The table definition.

onFlushCallbackConsumer

The on-flush callback. If not null, the consumer is called once at the beginning of each update cycle. It allows publishers to add any data that they may have been batching. It blocks the update cycle from proceeding, so implementations should take care not to do extraneous work.

onShutdownCallbackRunnable

The on-shutdown callback. If not null, the runnable is called one time when the caller should stop adding new data and release any related resources — for example, because publishFailure was called, the blink table is no longer reachable, or an internal failure occurred.

updateGraphUpdateGraph

The update graph for the blink table.

chunkSizeint

The maximum chunk size. The default value is 2048.

Returns

A new TablePublisher.

Methods

TablePublisher supports the following methods:

  • add(table) - Adds a table to the blink table.
  • definition - Gets the table definition.
  • inputTable - Gets the blink table with an InputTableUpdater attribute installed, so it can be used as an input table. Deleting rows is not supported. May return null if called more than once without the initial caller retaining a strong reference to the result.
  • isAlive - Checks if the table publisher is alive.
  • publishFailure(failure) - Indicates that data publication has failed. Listeners are notified, the on-shutdown callback is invoked (if it hasn't already been), and future calls to add return without doing anything.
  • table - Gets the blink table.

Examples

In this example, TablePublisher is used to create a blink table with three columns (X, Y, and Z). The columns are of type int, double, and double, respectively.

To add data to blink table, call add.

The source blink table after data has been added

To shut the publisher down, call publishFailure.