Chore: remove StreamHandler and DataStreamState (#21234)
* remove StreamHandler * remove DataStreamState
This commit is contained in:
committed by
Torkel Ödegaard
parent
6c2375e495
commit
8d537b7afb
@@ -373,62 +373,6 @@ export type LegacyResponseData = TimeSeries | TableData | any;
|
||||
|
||||
export type DataQueryResponseData = DataFrame | DataFrameDTO | LegacyResponseData;
|
||||
|
||||
export type DataStreamObserver = (event: DataStreamState) => void;
|
||||
|
||||
export interface DataStreamState {
|
||||
/**
|
||||
* when Done or Error no more events will be processed
|
||||
*/
|
||||
state: LoadingState;
|
||||
|
||||
/**
|
||||
* The key is used to identify unique sets of data within
|
||||
* a response, and join or replace them before sending them to the panel.
|
||||
*
|
||||
* For example consider a query that streams four DataFrames (A,B,C,D)
|
||||
* and multiple events with keys K1, and K2
|
||||
*
|
||||
* query(...) returns: {
|
||||
* state:Streaming
|
||||
* data:[A]
|
||||
* }
|
||||
*
|
||||
* Events:
|
||||
* 1. {key:K1, data:[B1]} >> PanelData: [A,B1]
|
||||
* 2. {key:K2, data:[C2,D2]} >> PanelData: [A,B1,C2,D2]
|
||||
* 3. {key:K1, data:[B3]} >> PanelData: [A,B3,C2,D2]
|
||||
* 4. {key:K2, data:[C4]} >> PanelData: [A,B3,C4]
|
||||
*
|
||||
* NOTE: that PanelData will not report a `Done` state until all
|
||||
* unique keys have returned with either `Error` or `Done` state.
|
||||
*/
|
||||
key: string;
|
||||
|
||||
/**
|
||||
* The stream request. The properties of this request will be examined
|
||||
* to determine if the stream matches the original query. If not, it
|
||||
* will be unsubscribed.
|
||||
*/
|
||||
request: DataQueryRequest;
|
||||
|
||||
/**
|
||||
* The streaming events return entire DataFrames. The DataSource
|
||||
* sending the events is responsible for truncating any growing lists
|
||||
* most likely to the requested `maxDataPoints`
|
||||
*/
|
||||
data?: DataFrame[];
|
||||
|
||||
/**
|
||||
* Error in stream (but may still be running)
|
||||
*/
|
||||
error?: DataQueryError;
|
||||
|
||||
/**
|
||||
* Stop listening to this stream
|
||||
*/
|
||||
unsubscribe: () => void;
|
||||
}
|
||||
|
||||
export interface DataQueryResponse {
|
||||
/**
|
||||
* The response data. When streaming, this may be empty
|
||||
|
||||
Reference in New Issue
Block a user