TablePublisher
The table_publisher method creates a TablePublisher. A TablePublisher produces a blink table from tables that are added to it via the add method.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| name | str | The name of the blink table. |
| col_defs | TableDefinitionLike | The blink table's column definitions. See |
| on_flush_callback optional | Callable | The on-flush callback, if present, is called once at the beginning of each update graph cycle. It allows publishers to add any data they may have been batching. This blocks the update cycle from proceeding, so implements should take care not to do extraneous work. The default is |
| on_shutdown_callback optional | Callable | An on-shutdown callback method. It is called once when the caller should stop adding new data and release any related resources. The default is |
| update_graph optional | UpdateGraph | The update graph that the resulting table belongs to. The default is |
| chunk_size optional | int | The size at which chunks of data are filled from the source table during an add. The default is 2048 rows. |
Returns
A tuple containing the resulting blink Table and the TablePublisher used to populate it.
Methods
TablePublisher supports the following methods:
add(table)- Adds a snapshot of the data fromtableinto the blink table. The table must contain a superset of the columns from the blink table's definition. The columns can be in any order. Columns fromtablethat are not in the blink table's definition are ignored.is_alive- Checks if the table is alive. ReturnsTrueif the table is alive, andFalseotherwise.publish_failure(failure)- Indicates that data publication has failed.
Examples
The following example creates a TablePublisher with three columns. It adds a table with three rows using add and new_table. add_to_table calls my_publisher.add, which adds three new rows to my_blink_table. Because my_blink_table is a blink table, it only reflects the rows added during the most recent update cycle; the two calls to add_to_table below happen within the same update cycle, so all six rows appear together.

Subsequent calls to add_to_table in later update cycles show only the rows created in that update cycle.
