Refactor ipc module (#1225)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-11-19 11:48:13 +02:00
1 parent c4b98534dc
commit 5aaacb21f9
20 files changed
+224 -242

No files matched your search

+2 -7
View File
@@ -4,7 +4,7 @@ import type { IMetricsReqParams } from "../renderer/api/endpoints/metrics.api";
import type { WorkspaceId } from "../common/workspace-store";
import { action, computed, observable, reaction, toJS, when } from "mobx";
import { apiKubePrefix } from "../common/vars";
import { broadcastIpc } from "../common/ipc";
import { broadcastMessage } from "../common/ipc";
import { ContextHandler } from "./context-handler"
import { AuthorizationV1Api, CoreV1Api, KubeConfig, V1ResourceAttributes } from "@kubernetes/client-node"
import { Kubectl } from "./kubectl";
@@ -50,7 +50,6 @@ export interface ClusterState {
export class Cluster implements ClusterModel, ClusterState {
public id: ClusterId;
public frameId: number;
public kubeCtl: Kubectl
public contextHandler: ContextHandler;
public ownerRef: string;
@@ -406,11 +405,7 @@ export class Cluster implements ClusterModel, ClusterState {
pushState(state = this.getState()) {
logger.silly(`[CLUSTER]: push-state`, state);
broadcastIpc({
channel: "cluster:state",
frameId: this.frameId,
args: [this.id, state],
})
broadcastMessage("cluster:state", this.id, state)
}
// get cluster system meta, e.g. use in "logger"