You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/03/22 18:37:45 UTC

[GitHub] [superset] robdiciuccio commented on a change in pull request #13696: feat: Refactor asyncEvent middleware and add websocket support

robdiciuccio commented on a change in pull request #13696:
URL: https://github.com/apache/superset/pull/13696#discussion_r598980966



##########
File path: superset-frontend/src/middleware/asyncEvent.ts
##########
@@ -25,178 +24,240 @@ import {
   parseErrorJson,
 } from '../utils/getClientErrorObject';
 
-export type AsyncEvent = {
-  id: string;
+type AsyncEvent = {
+  id?: string | null;
   channel_id: string;
   job_id: string;
-  user_id: string;
+  user_id?: string;
   status: string;
-  errors: SupersetError[];
-  result_url: string;
-};
-
-type AsyncEventOptions = {
-  config: {
-    GLOBAL_ASYNC_QUERIES_TRANSPORT: string;
-    GLOBAL_ASYNC_QUERIES_POLLING_DELAY: number;
-  };
-  getPendingComponents: (state: any) => any[];
-  successAction: (componentId: number, componentData: any) => { type: string };
-  errorAction: (componentId: number, response: any) => { type: string };
-  processEventsCallback?: (events: AsyncEvent[]) => void; // this is currently used only for tests
+  errors?: SupersetError[];
+  result_url: string | null;
 };
 
 type CachedDataResponse = {
-  componentId: number;
   status: string;
   data: any;
 };
+type AppConfig = Record<string, any>;
+type ListenerFn = (asyncEvent: AsyncEvent) => Promise<any>;

Review comment:
       This could be a response payload for SQL Lab as well (in the future), which is the reason why it's generic. Well, that and laziness.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org