@colabo-flow/s-go 0.1.2 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/demo/create-client.d.ts +1 -0
- package/dist/cjs/demo/create-host.d.ts +1 -0
- package/dist/cjs/demo/send.d.ts +1 -0
- package/{index.ts → dist/cjs/index.d.ts} +3 -4
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/jest.config.d.ts +3 -0
- package/dist/cjs/lib/config.d.ts +13 -0
- package/dist/cjs/lib/go.amqp.client.d.ts +4 -0
- package/dist/cjs/lib/go.amqp.host.d.ts +6 -0
- package/dist/cjs/lib/go.amqp.host_status.d.ts +1 -0
- package/dist/cjs/lib/go.amqp.service.d.ts +1 -0
- package/dist/cjs/lib/operators.d.ts +2 -0
- package/dist/cjs/lib/params.d.ts +1 -0
- package/dist/cjs/lib/vos.d.ts +173 -0
- package/dist/cjs/test_ts.d.ts +1 -0
- package/dist/cjs/tests/units/chalk/index.d.ts +21 -0
- package/dist/cjs/tests/units/tests-vos/tasks-and-flows.vos.d.ts +20 -0
- package/dist/esm/demo/create-client.d.ts +1 -0
- package/dist/esm/demo/create-host.d.ts +1 -0
- package/dist/esm/demo/send.d.ts +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/jest.config.d.ts +3 -0
- package/dist/esm/lib/config.d.ts +13 -0
- package/dist/esm/lib/go.amqp.client.d.ts +4 -0
- package/dist/esm/lib/go.amqp.host.d.ts +6 -0
- package/dist/esm/lib/go.amqp.host_status.d.ts +1 -0
- package/dist/esm/lib/go.amqp.service.d.ts +1 -0
- package/dist/esm/lib/operators.d.ts +2 -0
- package/dist/esm/lib/params.d.ts +1 -0
- package/dist/esm/lib/vos.d.ts +173 -0
- package/dist/esm/test_ts.d.ts +1 -0
- package/dist/esm/tests/units/chalk/index.d.ts +21 -0
- package/dist/esm/tests/units/tests-vos/tasks-and-flows.vos.d.ts +20 -0
- package/dist/index.d.ts +184 -0
- package/package.json +43 -6
- package/DEVELOPMENT.md +0 -38
- package/__init__.py +0 -0
- package/__pycache__/__init__.cpython-39.pyc +0 -0
- package/create_client.py +0 -84
- package/create_host.py +0 -91
- package/create_host_terra.py +0 -103
- package/demo/__init__.py +0 -0
- package/demo/create-client.ts +0 -51
- package/demo/create-host.ts +0 -136
- package/demo/send-simple-recommended.py +0 -26
- package/demo/send-simple.py +0 -50
- package/demo/send.py +0 -352
- package/demo/send.ts +0 -40
- package/demo/threading/README.md +0 -14
- package/demo/threading/basic_consumer_connection_threaded.png +0 -0
- package/demo/threading/basic_consumer_connection_threaded.py +0 -135
- package/demo/threading/basic_consumer_threaded.py +0 -100
- package/demo/threading/long-running-publisher.py +0 -68
- package/docs/ColaboFlow-infrastructure-diagram.png +0 -0
- package/docs/workflow.md +0 -35
- package/jest.config.ts +0 -172
- package/lib/__init__.py +0 -0
- package/lib/__pycache__/__init__.cpython-39.pyc +0 -0
- package/lib/__pycache__/config.cpython-39.pyc +0 -0
- package/lib/__pycache__/executor_operators.cpython-39.pyc +0 -0
- package/lib/__pycache__/executor_vos.cpython-39.pyc +0 -0
- package/lib/__pycache__/go_amqp_client.cpython-39.pyc +0 -0
- package/lib/__pycache__/go_amqp_client_threaded.cpython-39.pyc +0 -0
- package/lib/__pycache__/go_amqp_host.cpython-39.pyc +0 -0
- package/lib/__pycache__/operators.cpython-39.pyc +0 -0
- package/lib/__pycache__/vos.cpython-39.pyc +0 -0
- package/lib/config.py +0 -21
- package/lib/config.ts +0 -22
- package/lib/executor_operators.py +0 -23
- package/lib/executor_vos.py +0 -318
- package/lib/go.amqp.client-old-basic.py +0 -50
- package/lib/go.amqp.client.ts +0 -100
- package/lib/go.amqp.host-old-basic.py +0 -48
- package/lib/go.amqp.host.ts +0 -269
- package/lib/go.amqp.host_status.ts +0 -81
- package/lib/go.amqp.service.ts +0 -272
- package/lib/go_amqp_client.py +0 -263
- package/lib/go_amqp_client_non_threaded.py +0 -152
- package/lib/go_amqp_host.py +0 -348
- package/lib/operators.py +0 -16
- package/lib/operators.ts +0 -17
- package/lib/params.ts +0 -1
- package/lib/vos.py +0 -232
- package/lib/vos.ts +0 -212
- package/requirements.txt +0 -4
- package/tests/units/README.md +0 -12
- package/tests/units/chalk/index.ts +0 -41
- package/tests/units/go.amqp.host.test.ts +0 -116
- package/tests/units/tests-vos/tasks-and-flows.vos.ts +0 -128
- package/tsconfig.json +0 -45
- package/v1 - GRPC/README.md +0 -18
- package/v1 - GRPC/node/README.md +0 -13
- package/v1 - GRPC/node/colaboflow_go_actionhost_client.ts +0 -91
- package/v1 - GRPC/node/colaboflow_go_actionhost_server.ts +0 -84
- package/v1 - GRPC/node/colaboflow_go_client.ts +0 -82
- package/v1 - GRPC/node/colaboflow_go_server.ts +0 -84
- package/v1 - GRPC/node/demos/demo-colaboflow_go_actionhost_client.ts +0 -21
- package/v1 - GRPC/node/index.ts +0 -3
- package/v1 - GRPC/node/package-lock.json +0 -770
- package/v1 - GRPC/node/package.json +0 -30
- package/v1 - GRPC/node/tsconfig.json +0 -32
- package/v1 - GRPC/node/yarn.lock +0 -642
- package/v1 - GRPC/protos/colabo/flow/go/go.proto +0 -135
- package/v1 - GRPC/python/DEVELOPMENT.md +0 -86
- package/v1 - GRPC/python/DISCUSSION.md +0 -8
- package/v1 - GRPC/python/LICENSE.txt +0 -21
- package/v1 - GRPC/python/README.md +0 -45
- package/v1 - GRPC/python/__init__.py +0 -1
- package/v1 - GRPC/python/colabo/__init__.py +0 -3
- package/v1 - GRPC/python/colabo/flow/__init__.py +0 -3
- package/v1 - GRPC/python/colabo/flow/go/__init__.py +0 -12
- package/v1 - GRPC/python/colabo/flow/go/basic/PuzzleImporter.py +0 -77
- package/v1 - GRPC/python/colabo/flow/go/basic/__init__.py +0 -5
- package/v1 - GRPC/python/colabo/flow/go/basic/colaboflow_go_basic.py +0 -66
- package/v1 - GRPC/python/colabo/flow/go/basic/parseFlowJSON.py +0 -32
- package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_actionhost.py +0 -44
- package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_client.py +0 -48
- package/v1 - GRPC/python/colabo/flow/go/colaboflow_go_demo.py +0 -168
- package/v1 - GRPC/python/colabo/flow/go/go_pb2.py +0 -976
- package/v1 - GRPC/python/colabo/flow/go/go_pb2_grpc.py +0 -139
- package/v1 - GRPC/python/colabo.flow.go.egg-info/PKG-INFO +0 -58
- package/v1 - GRPC/python/colabo.flow.go.egg-info/SOURCES.txt +0 -16
- package/v1 - GRPC/python/colabo.flow.go.egg-info/dependency_links.txt +0 -1
- package/v1 - GRPC/python/colabo.flow.go.egg-info/requires.txt +0 -3
- package/v1 - GRPC/python/colabo.flow.go.egg-info/top_level.txt +0 -2
- package/v1 - GRPC/python/demo-0.py +0 -69
- package/v1 - GRPC/python/demo-1.py +0 -146
- package/v1 - GRPC/python/demo-actionhost.py +0 -47
- package/v1 - GRPC/python/demo-basic.md +0 -13
- package/v1 - GRPC/python/demo-basic.py +0 -38
- package/v1 - GRPC/python/demo-executeActionSync.py +0 -32
- package/v1 - GRPC/python/demo-flows/flow-demo.json +0 -36
- package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-a.py +0 -19
- package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-b.py +0 -21
- package/v1 - GRPC/python/demo-puzzles/puzzles/puzzle-c.py +0 -20
- package/v1 - GRPC/python/requirements.txt +0 -7
- package/v1 - GRPC/python/setup.py +0 -39
- package/v1 - GRPC/python/use-cases/__init__.py +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const reportsConfig: {
|
|
2
|
+
showHeartbeatMsgs: boolean;
|
|
3
|
+
showReportsMsgs: boolean;
|
|
4
|
+
showExecutionMsgs: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const connectConfig: {
|
|
7
|
+
APP_NAME: string;
|
|
8
|
+
AMQP_URL: string;
|
|
9
|
+
ORCHESTRATOR_QUEUE: string;
|
|
10
|
+
HOST_HEARTBEAT_QUEUE: string;
|
|
11
|
+
HOST_NODE_QUEUE: string;
|
|
12
|
+
HOST_PYTHON_QUEUE: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IColaboFlowClientData } from "./vos";
|
|
2
|
+
export declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
|
|
3
|
+
export declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any) => Promise<any>;
|
|
4
|
+
export declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IFlowTask, ITaskExecutor } from "@colabo-flow/i-core";
|
|
2
|
+
import { IColaboFlowHostData } from "./vos";
|
|
3
|
+
export declare const hostSetTitles: (host: IColaboFlowHostData) => void;
|
|
4
|
+
export declare const hostRegisterTaskExecutor: (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
|
|
5
|
+
export declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
|
|
6
|
+
export declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MODULE_NAME: string;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { IFlowTask, IFlowTaskInstance, ITaskExecutor } from "@colabo-flow/i-core";
|
|
2
|
+
import { Channel } from "amqplib";
|
|
3
|
+
declare type ChannelModel = any;
|
|
4
|
+
export declare enum EColaboFlowGoMsgType {
|
|
5
|
+
TASK_EXECUTE_REQUEST = "TASK_EXECUTE_REQUEST",
|
|
6
|
+
TASK_EXECUTE_PROGRESS = "TASK_EXECUTE_PROGRESS",
|
|
7
|
+
TASK_EXECUTE_RESPONSE = "TASK_EXECUTE_RESPONSE",
|
|
8
|
+
TASK_INSTANCES_REPORT__REQUEST = "TASK_INSTANCES_REPORT__REQUEST",
|
|
9
|
+
TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
|
|
10
|
+
HEARTBEAT = "HEARTBEAT"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An interface describing messages exchanged between ColaboFlow.GO peers
|
|
14
|
+
*/
|
|
15
|
+
export interface IColaboFlowGoMsg {
|
|
16
|
+
/** unique message id */
|
|
17
|
+
id: string;
|
|
18
|
+
type: EColaboFlowGoMsgType;
|
|
19
|
+
/** unique request id, should be kept the same along the course of a same single message exchange */
|
|
20
|
+
requestId: string;
|
|
21
|
+
/** the id of the message sender */
|
|
22
|
+
sender: string;
|
|
23
|
+
/** the name of the queue to reply to (if there is a reply to the message) */
|
|
24
|
+
replyTo?: string;
|
|
25
|
+
/** the list of proxies that forwarded the message */
|
|
26
|
+
proxies: string[];
|
|
27
|
+
/**
|
|
28
|
+
* list of msg ids with the history of the replying messages
|
|
29
|
+
*/
|
|
30
|
+
msgReplyChainIds: string[];
|
|
31
|
+
/** string message that can be used for human purpose mainly */
|
|
32
|
+
msg?: string;
|
|
33
|
+
/** extension for various types of messages */
|
|
34
|
+
extension?: any;
|
|
35
|
+
}
|
|
36
|
+
/** enumeration of all the languages that are supported by ColaboFlow */
|
|
37
|
+
export declare enum EProgrammingLanguageSupported {
|
|
38
|
+
/** Javascript or its extensions that will be compiled to JavaScript eventually (TypeScript, Coffeescript) */
|
|
39
|
+
JAVASCRIPT = "JAVASCRIPT",
|
|
40
|
+
PYTHON = "PYTHON",
|
|
41
|
+
NATIVE = "NATIVE"
|
|
42
|
+
}
|
|
43
|
+
/** Message extension for the heartbeat message */
|
|
44
|
+
export interface IColaboFlowGoMsgExtension_Heartbeat {
|
|
45
|
+
/** the id of the heartbeat pulse message */
|
|
46
|
+
id: number;
|
|
47
|
+
/** the programming language that the host speaks */
|
|
48
|
+
language: EProgrammingLanguageSupported;
|
|
49
|
+
/** the list of the tasks' ids that the host implements */
|
|
50
|
+
taskIds: string[];
|
|
51
|
+
/** The queue that the host listens to */
|
|
52
|
+
queueHost: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IColaboFlowGoMsgExtension_Heartbeat_Response {
|
|
55
|
+
/** the id of the heartbeat pulse message */
|
|
56
|
+
id: number;
|
|
57
|
+
/** the name of the service responding */
|
|
58
|
+
serviceName: string;
|
|
59
|
+
}
|
|
60
|
+
/** Message extension for the task execution request */
|
|
61
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Request {
|
|
62
|
+
/** the id of the task we want to execute */
|
|
63
|
+
taskId: string;
|
|
64
|
+
/** input to the task we want to execute */
|
|
65
|
+
taskInput: any;
|
|
66
|
+
}
|
|
67
|
+
export declare enum ETaskExecute_Progress_Status {
|
|
68
|
+
INITIALIZED = "INITIALIZED"
|
|
69
|
+
}
|
|
70
|
+
/** Message extension for the task execution response */
|
|
71
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Progress {
|
|
72
|
+
/** the id if the task executing instance */
|
|
73
|
+
taskInstanceId: string;
|
|
74
|
+
/** the current status of the task execution */
|
|
75
|
+
status: ETaskExecute_Progress_Status;
|
|
76
|
+
/** the percentage of the task executed */
|
|
77
|
+
progress: number;
|
|
78
|
+
}
|
|
79
|
+
/** Message extension for the task execution response */
|
|
80
|
+
export interface IColaboFlowGoMsgExtension_TaskExecute_Response {
|
|
81
|
+
/** output of the executed task */
|
|
82
|
+
taskOutput: any;
|
|
83
|
+
}
|
|
84
|
+
/** Message extension for the task instances report requesting */
|
|
85
|
+
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Request {
|
|
86
|
+
reportFinalizedTaskInstances: boolean;
|
|
87
|
+
reportRunningTaskInstances: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** Message extension for the task instances report response */
|
|
90
|
+
export interface IColaboFlowGoMsgExtension_TaskInstancesReport_Response {
|
|
91
|
+
tasksInstanceInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
95
|
+
*/
|
|
96
|
+
export interface IColaboFlowGoTaskInstanceInfo {
|
|
97
|
+
/** taskInstance id */
|
|
98
|
+
id: string;
|
|
99
|
+
/** task instance */
|
|
100
|
+
taskInstance: IFlowTaskInstance;
|
|
101
|
+
}
|
|
102
|
+
/** contains all the data that are necessary for a ColaboFlow.Go host to operate */
|
|
103
|
+
export interface IColaboFlowHostData {
|
|
104
|
+
hostname: string;
|
|
105
|
+
appNameText?: string;
|
|
106
|
+
amqpUrl: string;
|
|
107
|
+
queueHost: string;
|
|
108
|
+
queueHostHeartbeat: string;
|
|
109
|
+
chHostHeartbeat?: Channel;
|
|
110
|
+
taskExecutorsAvailable: Record<string, ITaskExecutor>;
|
|
111
|
+
tasksAvailable: Record<string, IFlowTask>;
|
|
112
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
113
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
114
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
115
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
116
|
+
*/
|
|
117
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
118
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
119
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
120
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
121
|
+
*/
|
|
122
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
123
|
+
}
|
|
124
|
+
/** contains all the data that are necessary for a ColaboFlow.Go client to operate */
|
|
125
|
+
export interface IColaboFlowClientData {
|
|
126
|
+
clientName: string;
|
|
127
|
+
appNameText?: string;
|
|
128
|
+
amqpUrl: string;
|
|
129
|
+
queueServiceOrchestrator: string;
|
|
130
|
+
connection?: ChannelModel;
|
|
131
|
+
channel?: Channel;
|
|
132
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
133
|
+
}
|
|
134
|
+
/** Contains all the data that are necessary for a ColaboFlow.Go service to handle a node */
|
|
135
|
+
export interface IColaboFlowServiceHostData {
|
|
136
|
+
/** the name of the host */
|
|
137
|
+
hostName: string;
|
|
138
|
+
/** the name of the queue host listens on */
|
|
139
|
+
queueHost: string;
|
|
140
|
+
/** tasks' ids available for a specific host */
|
|
141
|
+
taskIdsAvailable: string[];
|
|
142
|
+
/** tasks instances' ids available for a specific host */
|
|
143
|
+
taskInstanceIds: string[];
|
|
144
|
+
}
|
|
145
|
+
/** contains all the data that are necessary for a ColaboFlow.Go service to operate */
|
|
146
|
+
export interface IColaboFlowServiceData {
|
|
147
|
+
serviceName: string;
|
|
148
|
+
amqpUrl: string;
|
|
149
|
+
/** the heartbeat queue that the service uses to listens heartbeat (registration) for the hosts */
|
|
150
|
+
queueHostHeartbeat: string;
|
|
151
|
+
/** the orchestrator queue that the service uses to listens from the clients */
|
|
152
|
+
queueOrchestrator: string;
|
|
153
|
+
/** the channel for the clients communication */
|
|
154
|
+
clientsChannel?: Channel;
|
|
155
|
+
/** the channel for the hosts communication */
|
|
156
|
+
hostsChannel?: Channel;
|
|
157
|
+
/** infos about each host known to the service
|
|
158
|
+
* currently hosts are discovered by receiving heartbeat messages from the hosts
|
|
159
|
+
*/
|
|
160
|
+
hosts: Record<string, IColaboFlowServiceHostData>;
|
|
161
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
162
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
163
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
164
|
+
*/
|
|
165
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
166
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
167
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
168
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
169
|
+
*/
|
|
170
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
171
|
+
hostsForTaskIds: Record<string, string[]>;
|
|
172
|
+
}
|
|
173
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function chalk(msg: any): string;
|
|
2
|
+
export declare namespace chalk {
|
|
3
|
+
var red: typeof chalk;
|
|
4
|
+
var blue: typeof chalk;
|
|
5
|
+
var bold: typeof chalk;
|
|
6
|
+
var green: typeof chalk;
|
|
7
|
+
var yellow: typeof chalk;
|
|
8
|
+
var white: typeof chalk;
|
|
9
|
+
var grey: typeof chalk;
|
|
10
|
+
var dim: typeof chalk;
|
|
11
|
+
var italic: typeof chalk;
|
|
12
|
+
var redBright: typeof chalk;
|
|
13
|
+
var blueBright: typeof chalk;
|
|
14
|
+
var boldBright: typeof chalk;
|
|
15
|
+
var greenBright: typeof chalk;
|
|
16
|
+
var yellowBright: typeof chalk;
|
|
17
|
+
var whiteBright: typeof chalk;
|
|
18
|
+
var greyBright: typeof chalk;
|
|
19
|
+
var rgb: (r: number, g: number, b: number) => Function;
|
|
20
|
+
}
|
|
21
|
+
export default chalk;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IFlowTask, IFlow, IFlowToken, IFlowEvent, IFlowSequence } from "@colabo-flow/i-core";
|
|
2
|
+
export declare const taskId1 = "task-1-id";
|
|
3
|
+
export declare const taskId2 = "task-2-id";
|
|
4
|
+
export declare const tokenId1 = "token-1-id";
|
|
5
|
+
export declare const eventId1 = "event-1-id";
|
|
6
|
+
export declare const eventId2 = "event-2-id";
|
|
7
|
+
export declare const gatewayId1 = "gateway-1-id";
|
|
8
|
+
export declare const gatewayId2 = "gateway-2-id";
|
|
9
|
+
export declare const sequenceId1 = "sequence-1-id";
|
|
10
|
+
export declare const sequenceId2 = "sequence-2-id";
|
|
11
|
+
export declare const sequenceId3 = "sequence-3-id";
|
|
12
|
+
export declare const task1: IFlowTask;
|
|
13
|
+
export declare const task2: IFlowTask;
|
|
14
|
+
export declare const event1: IFlowEvent;
|
|
15
|
+
export declare const event2: IFlowEvent;
|
|
16
|
+
export declare const token1: IFlowToken;
|
|
17
|
+
export declare const sequence1: IFlowSequence;
|
|
18
|
+
export declare const sequence2: IFlowSequence;
|
|
19
|
+
export declare const sequence3: IFlowSequence;
|
|
20
|
+
export declare const flow: IFlow;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { IFlowTaskInstance, ITaskExecutor, IFlowTask } from '@colabo-flow/i-core';
|
|
2
|
+
import { Channel } from 'amqplib';
|
|
3
|
+
|
|
4
|
+
declare type ChannelModel = any;
|
|
5
|
+
declare enum EColaboFlowGoMsgType {
|
|
6
|
+
TASK_EXECUTE_REQUEST = "TASK_EXECUTE_REQUEST",
|
|
7
|
+
TASK_EXECUTE_PROGRESS = "TASK_EXECUTE_PROGRESS",
|
|
8
|
+
TASK_EXECUTE_RESPONSE = "TASK_EXECUTE_RESPONSE",
|
|
9
|
+
TASK_INSTANCES_REPORT__REQUEST = "TASK_INSTANCES_REPORT__REQUEST",
|
|
10
|
+
TASK_INSTANCES_REPORT__RESPONSE = "TASK_INSTANCES_REPORT__RESPONSE",
|
|
11
|
+
HEARTBEAT = "HEARTBEAT"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* An interface describing messages exchanged between ColaboFlow.GO peers
|
|
15
|
+
*/
|
|
16
|
+
interface IColaboFlowGoMsg {
|
|
17
|
+
/** unique message id */
|
|
18
|
+
id: string;
|
|
19
|
+
type: EColaboFlowGoMsgType;
|
|
20
|
+
/** unique request id, should be kept the same along the course of a same single message exchange */
|
|
21
|
+
requestId: string;
|
|
22
|
+
/** the id of the message sender */
|
|
23
|
+
sender: string;
|
|
24
|
+
/** the name of the queue to reply to (if there is a reply to the message) */
|
|
25
|
+
replyTo?: string;
|
|
26
|
+
/** the list of proxies that forwarded the message */
|
|
27
|
+
proxies: string[];
|
|
28
|
+
/**
|
|
29
|
+
* list of msg ids with the history of the replying messages
|
|
30
|
+
*/
|
|
31
|
+
msgReplyChainIds: string[];
|
|
32
|
+
/** string message that can be used for human purpose mainly */
|
|
33
|
+
msg?: string;
|
|
34
|
+
/** extension for various types of messages */
|
|
35
|
+
extension?: any;
|
|
36
|
+
}
|
|
37
|
+
/** enumeration of all the languages that are supported by ColaboFlow */
|
|
38
|
+
declare enum EProgrammingLanguageSupported {
|
|
39
|
+
/** Javascript or its extensions that will be compiled to JavaScript eventually (TypeScript, Coffeescript) */
|
|
40
|
+
JAVASCRIPT = "JAVASCRIPT",
|
|
41
|
+
PYTHON = "PYTHON",
|
|
42
|
+
NATIVE = "NATIVE"
|
|
43
|
+
}
|
|
44
|
+
/** Message extension for the heartbeat message */
|
|
45
|
+
interface IColaboFlowGoMsgExtension_Heartbeat {
|
|
46
|
+
/** the id of the heartbeat pulse message */
|
|
47
|
+
id: number;
|
|
48
|
+
/** the programming language that the host speaks */
|
|
49
|
+
language: EProgrammingLanguageSupported;
|
|
50
|
+
/** the list of the tasks' ids that the host implements */
|
|
51
|
+
taskIds: string[];
|
|
52
|
+
/** The queue that the host listens to */
|
|
53
|
+
queueHost: string;
|
|
54
|
+
}
|
|
55
|
+
interface IColaboFlowGoMsgExtension_Heartbeat_Response {
|
|
56
|
+
/** the id of the heartbeat pulse message */
|
|
57
|
+
id: number;
|
|
58
|
+
/** the name of the service responding */
|
|
59
|
+
serviceName: string;
|
|
60
|
+
}
|
|
61
|
+
/** Message extension for the task execution request */
|
|
62
|
+
interface IColaboFlowGoMsgExtension_TaskExecute_Request {
|
|
63
|
+
/** the id of the task we want to execute */
|
|
64
|
+
taskId: string;
|
|
65
|
+
/** input to the task we want to execute */
|
|
66
|
+
taskInput: any;
|
|
67
|
+
}
|
|
68
|
+
declare enum ETaskExecute_Progress_Status {
|
|
69
|
+
INITIALIZED = "INITIALIZED"
|
|
70
|
+
}
|
|
71
|
+
/** Message extension for the task execution response */
|
|
72
|
+
interface IColaboFlowGoMsgExtension_TaskExecute_Progress {
|
|
73
|
+
/** the id if the task executing instance */
|
|
74
|
+
taskInstanceId: string;
|
|
75
|
+
/** the current status of the task execution */
|
|
76
|
+
status: ETaskExecute_Progress_Status;
|
|
77
|
+
/** the percentage of the task executed */
|
|
78
|
+
progress: number;
|
|
79
|
+
}
|
|
80
|
+
/** Message extension for the task execution response */
|
|
81
|
+
interface IColaboFlowGoMsgExtension_TaskExecute_Response {
|
|
82
|
+
/** output of the executed task */
|
|
83
|
+
taskOutput: any;
|
|
84
|
+
}
|
|
85
|
+
/** Message extension for the task instances report requesting */
|
|
86
|
+
interface IColaboFlowGoMsgExtension_TaskInstancesReport_Request {
|
|
87
|
+
reportFinalizedTaskInstances: boolean;
|
|
88
|
+
reportRunningTaskInstances: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** Message extension for the task instances report response */
|
|
91
|
+
interface IColaboFlowGoMsgExtension_TaskInstancesReport_Response {
|
|
92
|
+
tasksInstanceInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
96
|
+
*/
|
|
97
|
+
interface IColaboFlowGoTaskInstanceInfo {
|
|
98
|
+
/** taskInstance id */
|
|
99
|
+
id: string;
|
|
100
|
+
/** task instance */
|
|
101
|
+
taskInstance: IFlowTaskInstance;
|
|
102
|
+
}
|
|
103
|
+
/** contains all the data that are necessary for a ColaboFlow.Go host to operate */
|
|
104
|
+
interface IColaboFlowHostData {
|
|
105
|
+
hostname: string;
|
|
106
|
+
appNameText?: string;
|
|
107
|
+
amqpUrl: string;
|
|
108
|
+
queueHost: string;
|
|
109
|
+
queueHostHeartbeat: string;
|
|
110
|
+
chHostHeartbeat?: Channel;
|
|
111
|
+
taskExecutorsAvailable: Record<string, ITaskExecutor>;
|
|
112
|
+
tasksAvailable: Record<string, IFlowTask>;
|
|
113
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
114
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
115
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
116
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
117
|
+
*/
|
|
118
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
119
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
120
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
121
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
122
|
+
*/
|
|
123
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
124
|
+
}
|
|
125
|
+
/** contains all the data that are necessary for a ColaboFlow.Go client to operate */
|
|
126
|
+
interface IColaboFlowClientData {
|
|
127
|
+
clientName: string;
|
|
128
|
+
appNameText?: string;
|
|
129
|
+
amqpUrl: string;
|
|
130
|
+
queueServiceOrchestrator: string;
|
|
131
|
+
connection?: ChannelModel;
|
|
132
|
+
channel?: Channel;
|
|
133
|
+
taskInstances: Record<string, IFlowTaskInstance>;
|
|
134
|
+
}
|
|
135
|
+
/** Contains all the data that are necessary for a ColaboFlow.Go service to handle a node */
|
|
136
|
+
interface IColaboFlowServiceHostData {
|
|
137
|
+
/** the name of the host */
|
|
138
|
+
hostName: string;
|
|
139
|
+
/** the name of the queue host listens on */
|
|
140
|
+
queueHost: string;
|
|
141
|
+
/** tasks' ids available for a specific host */
|
|
142
|
+
taskIdsAvailable: string[];
|
|
143
|
+
/** tasks instances' ids available for a specific host */
|
|
144
|
+
taskInstanceIds: string[];
|
|
145
|
+
}
|
|
146
|
+
/** contains all the data that are necessary for a ColaboFlow.Go service to operate */
|
|
147
|
+
interface IColaboFlowServiceData {
|
|
148
|
+
serviceName: string;
|
|
149
|
+
amqpUrl: string;
|
|
150
|
+
/** the heartbeat queue that the service uses to listens heartbeat (registration) for the hosts */
|
|
151
|
+
queueHostHeartbeat: string;
|
|
152
|
+
/** the orchestrator queue that the service uses to listens from the clients */
|
|
153
|
+
queueOrchestrator: string;
|
|
154
|
+
/** the channel for the clients communication */
|
|
155
|
+
clientsChannel?: Channel;
|
|
156
|
+
/** the channel for the hosts communication */
|
|
157
|
+
hostsChannel?: Channel;
|
|
158
|
+
/** infos about each host known to the service
|
|
159
|
+
* currently hosts are discovered by receiving heartbeat messages from the hosts
|
|
160
|
+
*/
|
|
161
|
+
hosts: Record<string, IColaboFlowServiceHostData>;
|
|
162
|
+
/** Provides all required info about the task execution requests (except the executed ones) coming for this particular host and its progress, etc
|
|
163
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
164
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
165
|
+
*/
|
|
166
|
+
runningTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
167
|
+
/** Provides all required info about the finalized (finished, stopped, failed, ...) task execution requests coming for this particular host and its progress, etc
|
|
168
|
+
* Provides all required info about the task execution request and its progress, etc
|
|
169
|
+
* ***record key*** is the `id` of the `taskInstance`
|
|
170
|
+
*/
|
|
171
|
+
finalizedTaskInstancesInfos: Record<string, IColaboFlowGoTaskInstanceInfo>;
|
|
172
|
+
hostsForTaskIds: Record<string, string[]>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const clientRun: (client: IColaboFlowClientData) => Promise<void>;
|
|
176
|
+
declare const clientExecuteTask: (client: IColaboFlowClientData, taskId: string, taskInput?: any) => Promise<any>;
|
|
177
|
+
declare const clientClose: (client: IColaboFlowClientData) => Promise<boolean>;
|
|
178
|
+
|
|
179
|
+
declare const hostSetTitles: (host: IColaboFlowHostData) => void;
|
|
180
|
+
declare const hostRegisterTaskExecutor: (host: IColaboFlowHostData, executor: ITaskExecutor) => void;
|
|
181
|
+
declare const hostRegisterTask: (host: IColaboFlowHostData, task: IFlowTask) => void;
|
|
182
|
+
declare const hostRun: (host: IColaboFlowHostData) => Promise<void>;
|
|
183
|
+
|
|
184
|
+
export { EColaboFlowGoMsgType, EProgrammingLanguageSupported, ETaskExecute_Progress_Status, IColaboFlowClientData, IColaboFlowGoMsg, IColaboFlowGoMsgExtension_Heartbeat, IColaboFlowGoMsgExtension_Heartbeat_Response, IColaboFlowGoMsgExtension_TaskExecute_Progress, IColaboFlowGoMsgExtension_TaskExecute_Request, IColaboFlowGoMsgExtension_TaskExecute_Response, IColaboFlowGoMsgExtension_TaskInstancesReport_Request, IColaboFlowGoMsgExtension_TaskInstancesReport_Response, IColaboFlowGoTaskInstanceInfo, IColaboFlowHostData, IColaboFlowServiceData, IColaboFlowServiceHostData, clientClose, clientExecuteTask, clientRun, hostRegisterTask, hostRegisterTaskExecutor, hostRun, hostSetTitles };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colabo-flow/s-go",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "ColaboFlow Puzzle
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "ColaboFlow.Go Puzzle implementing Colabo Flow.Go service",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
@@ -13,12 +13,29 @@
|
|
|
13
13
|
"url": "https://github.com/Cha-OS/colabo"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "",
|
|
17
|
-
"_build": "tsc",
|
|
16
|
+
"build": "rollup -c",
|
|
18
17
|
"test:coverage": "jest"
|
|
19
18
|
},
|
|
20
|
-
"main": "index.
|
|
19
|
+
"main": "dist/cjs/index.js",
|
|
20
|
+
"module": "dist/esm/index.js",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/esm/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"typings": "dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
21
32
|
"dependencies": {
|
|
33
|
+
"@colabo-datatalks/i-cache": "^0.6.2",
|
|
34
|
+
"@colabo-flow/i-core": "^0.8.5",
|
|
35
|
+
"@colabo-headless/i-core": "npm:@colabo-headless/i-core-backend@0.1.5",
|
|
36
|
+
"@colabo-transform/i-json": "^0.2.2",
|
|
37
|
+
"@colabo-utils/i-config": "^0.1.7",
|
|
38
|
+
"@colabo-utils/i-verify": "^0.1.7",
|
|
22
39
|
"amqplib": "^0.10.3",
|
|
23
40
|
"chalk": "^5.1.2",
|
|
24
41
|
"ts-jest": "^29.0.3",
|
|
@@ -26,11 +43,31 @@
|
|
|
26
43
|
},
|
|
27
44
|
"peerDependenciesLocal": {},
|
|
28
45
|
"devDependencies": {
|
|
46
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
47
|
+
"@rollup/plugin-json": "^5.0.1",
|
|
48
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
49
|
+
"@rollup/plugin-typescript": "^9.0.2",
|
|
50
|
+
"@types/amqplib": "^0.8.2",
|
|
29
51
|
"@types/jest": "^29.2.2",
|
|
52
|
+
"@types/node": "^18.11.9",
|
|
30
53
|
"@types/uuid": "^8.3.4",
|
|
31
54
|
"jest": "^29.3.1",
|
|
32
55
|
"mocha-clearscreen-reporter": "^1.0.1",
|
|
56
|
+
"rollup": "^2.77.0",
|
|
57
|
+
"rollup-plugin-dts": "^5.0.0",
|
|
58
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
60
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
61
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
62
|
+
"source-map-loader": "^4.0.0",
|
|
33
63
|
"ts-jest": "^29.0.3",
|
|
34
|
-
"
|
|
64
|
+
"ts-loader": "^9.3.1",
|
|
65
|
+
"ts-node": "^10.9.1",
|
|
66
|
+
"tsconfig-paths": "^4.0.0",
|
|
67
|
+
"tslib": "^2.4.1",
|
|
68
|
+
"tslint": "^6.1.3",
|
|
69
|
+
"typescript": "^4.8.4",
|
|
70
|
+
"webpack": "^5.73.0",
|
|
71
|
+
"webpack-cli": "^4.10.0"
|
|
35
72
|
}
|
|
36
73
|
}
|
package/DEVELOPMENT.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
Based on
|
|
2
|
-
|
|
3
|
-
+ [rabbitmq demos](/colabo-business-services/rabbitmq/service-send.js)
|
|
4
|
-
+ [similarity.service.ts](/colabo/src/frontend/dev_puzzles/ai-ml/similarity/lib/similarity.service.ts)
|
|
5
|
-
+ [backend service](/colabo/src/backend/dev_puzzles/flow/services)
|
|
6
|
-
+ [ColaboFlowService](/colabo/src/backend/dev_puzzles/flow/services/index.ts)
|
|
7
|
-
+ [demo](/colabo/src/backend/dev_puzzles/flow/services/demo/demo.ts)
|
|
8
|
-
+ [ColaboFlowServiceWorker.py](/colabo-business-services/similarity/colaboflow/services/ColaboFlowServiceWorker.py)
|
|
9
|
-
+ [similarity_functions.py](/colabo-business-services/similarity/similarity_functions.py)
|
|
10
|
-
+ [similarity_functions_wrapper_colaboflow.py](/colabo-business-services/similarity/similarity_functions_wrapper_colaboflow.py)
|
|
11
|
-
+ [i-flow puzzles](/colabo/src/isomorphic/dev_puzzles/flow)
|
|
12
|
-
+ [@colabo-flow/b-topichat](/colabo/src/backend/dev_puzzles/flow/topichat)
|
|
13
|
-
+ [frontend interface to the cFlow service](colabo/src/frontend/dev_puzzles/flow/topichat/lib/colaboFlow-topiChat-form/)
|
|
14
|
-
+ [colaboFlow-topiChat-form.component.html](/colabo/src/frontend/dev_puzzles/flow/topichat/lib/colaboFlow-topiChat-form/colaboFlow-topiChat-form.component.html)
|
|
15
|
-
|
|
16
|
-
# Official
|
|
17
|
-
|
|
18
|
-
https://github.com/amqp-node/amqplib
|
|
19
|
-
|
|
20
|
-
https://amqp-node.github.io/amqplib/channel_api.html
|
|
21
|
-
|
|
22
|
-
[examples/tutorials/send.js](https://github.com/amqp-node/amqplib/blob/main/examples/tutorials/send.js)
|
|
23
|
-
|
|
24
|
-
# Problems
|
|
25
|
-
|
|
26
|
-
As we are migrating from CommonJS I had manually change the path for the `@colabo-flow/i-core` puzzle to a correct path in the new branch `colabo-vue3` in [`tsconfig.colabo.json`](../../../tsconfig.colabo.json)
|
|
27
|
-
|
|
28
|
-
```json5
|
|
29
|
-
"@colabo-flow/i-core": [
|
|
30
|
-
"/Users/mprinc/data/development/colabo-zontik/colabo/src/isomorphic/dev_puzzles/flow/core"
|
|
31
|
-
],
|
|
32
|
-
"@colabo-flow/i-core/*": [
|
|
33
|
-
"/Users/mprinc/data/development/colabo-zontik/colabo-vue3/src/isomorphic/dev_puzzles/flow/core/*"
|
|
34
|
-
],
|
|
35
|
-
"@colabo-utils/i-verify": [
|
|
36
|
-
"/Users/mprinc/data/development/colabo-zontik/colabo-vue3/src/isomorphic/dev_puzzles/utils/verify"
|
|
37
|
-
],
|
|
38
|
-
```
|
package/__init__.py
DELETED
|
File without changes
|
|
Binary file
|
package/create_client.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# https://pypi.org/project/pika/
|
|
3
|
-
import pika
|
|
4
|
-
import json
|
|
5
|
-
from yachalk import chalk
|
|
6
|
-
# from dataclasses import replace
|
|
7
|
-
# https://docs.python.org/3/library/uuid.html
|
|
8
|
-
import uuid
|
|
9
|
-
from typing import Any
|
|
10
|
-
import threading
|
|
11
|
-
import asyncio
|
|
12
|
-
|
|
13
|
-
from lib.config import connectConfig
|
|
14
|
-
# from lib.go_amqp_client import run, executeTask, close
|
|
15
|
-
from lib.go_amqp_client import run, executeTask, stop_consuming, close
|
|
16
|
-
|
|
17
|
-
from lib.vos import IColaboFlowClientData
|
|
18
|
-
|
|
19
|
-
clientName = "client-python-1"
|
|
20
|
-
appNameText = f'[{chalk.red.bold("Colabo")}{chalk.blue.bold("Flow")}{chalk.green.bold(".Go")}.{chalk.white.bold(clientName)}]';
|
|
21
|
-
|
|
22
|
-
def appNameTextWithContext(context: str) -> str:
|
|
23
|
-
threadId = threading.get_native_id()
|
|
24
|
-
return f'[[{chalk.blue.bold(threadId)}]{chalk.red.bold("Colabo")}{chalk.blue.bold("Flow")}{chalk.green.bold(".Go")}.{chalk.white.bold(clientName)}:{chalk.yellow.bold(context)}]';
|
|
25
|
-
|
|
26
|
-
clientPython1 = IColaboFlowClientData(
|
|
27
|
-
clientName = clientName,
|
|
28
|
-
appNameText = appNameText,
|
|
29
|
-
appNameTextWithContext = appNameTextWithContext,
|
|
30
|
-
amqpUrl = connectConfig.AMQP_URL,
|
|
31
|
-
queueServiceOrchestrator = connectConfig.ORCHESTRATOR_QUEUE,
|
|
32
|
-
|
|
33
|
-
taskInstances = {},
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
async def main():
|
|
37
|
-
print(f"{appNameTextWithContext('main')} Initializing ColaboFlow")
|
|
38
|
-
|
|
39
|
-
await run(clientPython1)
|
|
40
|
-
|
|
41
|
-
# print(f"{appNameTextWithContext('main')} Launching Task 1")
|
|
42
|
-
|
|
43
|
-
# task1Id: str = "com.welcometerra.video.ffmpeg-combine"
|
|
44
|
-
# task1Input: Any = {
|
|
45
|
-
# "a": 5,
|
|
46
|
-
# "b": 3,
|
|
47
|
-
# }
|
|
48
|
-
# task1OutputPromised = asyncio.create_task(
|
|
49
|
-
# executeTask(clientPython1, task1Id, task1Input)
|
|
50
|
-
# )
|
|
51
|
-
|
|
52
|
-
# print(f"{appNameTextWithContext('main')} Launching Task 2")
|
|
53
|
-
|
|
54
|
-
# task2Id: str = "colabo.flow.demo.reduce"
|
|
55
|
-
# task2Input: Any = {
|
|
56
|
-
# "a": 5,
|
|
57
|
-
# "b": 8,
|
|
58
|
-
# }
|
|
59
|
-
# task2Output = await executeTask(clientPython1, task2Id, task2Input)
|
|
60
|
-
# print(f"{appNameTextWithContext('main')} Task 2 Execution taskOutput: {chalk.blue.bold(task2Output)}")
|
|
61
|
-
|
|
62
|
-
print(f"{appNameTextWithContext('main')} Launching Task 3")
|
|
63
|
-
|
|
64
|
-
task3Id: str = "com.welcometerra.video.ffmpeg-multiple"
|
|
65
|
-
task3Input: Any = {
|
|
66
|
-
"a": 5,
|
|
67
|
-
"b": 5,
|
|
68
|
-
}
|
|
69
|
-
task3Output = await executeTask(clientPython1, task3Id, task3Input)
|
|
70
|
-
print(f"{appNameTextWithContext('main')} Task 3 Execution taskOutput: {chalk.blue.bold(task3Output)}")
|
|
71
|
-
|
|
72
|
-
# task1Output = await task1OutputPromised
|
|
73
|
-
# print(f"{appNameTextWithContext('main')} Task 1 Execution taskOutput: {chalk.blue.bold(task1Output)}")
|
|
74
|
-
|
|
75
|
-
close(clientPython1)
|
|
76
|
-
|
|
77
|
-
try:
|
|
78
|
-
asyncio.run(main())
|
|
79
|
-
except KeyboardInterrupt:
|
|
80
|
-
# extra line to compensate the CTRL+C keystroke
|
|
81
|
-
print(f"")
|
|
82
|
-
print(f"{appNameTextWithContext('main')} keyboard interrupt, _stop_consuming")
|
|
83
|
-
stop_consuming(clientPython1)
|
|
84
|
-
close(hostPython1)
|