@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
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#!/usr/bin/python
|
|
3
|
-
|
|
4
|
-
from __future__ import print_function
|
|
5
|
-
|
|
6
|
-
import random
|
|
7
|
-
|
|
8
|
-
from datetime import datetime
|
|
9
|
-
# import dateutil.parser
|
|
10
|
-
|
|
11
|
-
class ColaboFlowGoDemo():
|
|
12
|
-
goRequestDefault = None
|
|
13
|
-
stubDefault = None
|
|
14
|
-
|
|
15
|
-
def __init__(self, flowName="basic-flow"):
|
|
16
|
-
|
|
17
|
-
print("[ColaboFlowGoDemo] new flow created: %s" % (flowName))
|
|
18
|
-
self.flow = []
|
|
19
|
-
self.flowPointer = 0
|
|
20
|
-
|
|
21
|
-
# ---------------------------------------------------------------------------------------
|
|
22
|
-
# NOTE: SEQUENTIAL DATA FLOW: In this scenario, user can describe control flow order,
|
|
23
|
-
# but the data flow HAS to follow the same control-flow
|
|
24
|
-
# (so data output of action `i` is the input for the action `i+1`)
|
|
25
|
-
# ---------------------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
# Add action in a sequence with
|
|
28
|
-
# - action name and
|
|
29
|
-
# = reference to the function implementing it
|
|
30
|
-
def addActionAsFunction(self, funcRef, actionName):
|
|
31
|
-
action = {
|
|
32
|
-
'name': actionName,
|
|
33
|
-
'funcRef': funcRef
|
|
34
|
-
}
|
|
35
|
-
self.flow.append(action)
|
|
36
|
-
# print(len(self.flow))
|
|
37
|
-
return self
|
|
38
|
-
|
|
39
|
-
# runs functions in a sequence
|
|
40
|
-
# data input for the function `i+1` is data output of the function `i`
|
|
41
|
-
def runWithSequentialDataFlow(self, dataIn):
|
|
42
|
-
print("---")
|
|
43
|
-
for action in self.flow:
|
|
44
|
-
print("running action: ", action['name'])
|
|
45
|
-
func = action['funcRef']
|
|
46
|
-
result = func(dataIn)
|
|
47
|
-
print("result: ", result)
|
|
48
|
-
dataIn = result
|
|
49
|
-
print("---")
|
|
50
|
-
|
|
51
|
-
# ---------------------------------------------------------------------------------------
|
|
52
|
-
# NOTE: DESCRIPTIVE_DATA_FLOW: In this way data flow doesn't need to follow control flow
|
|
53
|
-
# but it can be described separtelly
|
|
54
|
-
# ---------------------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
# Add action in a sequence with
|
|
57
|
-
# - action name
|
|
58
|
-
# - reference to the function implementing it
|
|
59
|
-
# - inputParameterName name that holds the input parameter
|
|
60
|
-
def addActionAsFunctionWithInputParam(self, funcRef, actionName, inputParameterName=None):
|
|
61
|
-
action = {
|
|
62
|
-
'name': actionName,
|
|
63
|
-
'funcRef': funcRef,
|
|
64
|
-
'inputParameterName': inputParameterName
|
|
65
|
-
}
|
|
66
|
-
self.flow.append(action)
|
|
67
|
-
# print(len(self.flow))
|
|
68
|
-
return self
|
|
69
|
-
|
|
70
|
-
def runWithDescriptiveDataFlow(self, dataName, dataIn):
|
|
71
|
-
print("---")
|
|
72
|
-
self.results = {}
|
|
73
|
-
self.results[dataName] = dataIn
|
|
74
|
-
for action in self.flow:
|
|
75
|
-
# print("running action: ", action)
|
|
76
|
-
print("running action: ", action['name'])
|
|
77
|
-
func = action['funcRef']
|
|
78
|
-
inputParameterName = action['inputParameterName']
|
|
79
|
-
result = func(self.results[inputParameterName])
|
|
80
|
-
self.results[action['name']] = result
|
|
81
|
-
print("result: ", result)
|
|
82
|
-
print("---")
|
|
83
|
-
|
|
84
|
-
# ---------------------------------------------------------------------------------------
|
|
85
|
-
# NOTE: DESCRIPTIVE_MULTIDATA_FLOW: data flow doesn't follow control flow
|
|
86
|
-
# and it can have multiple input datasets
|
|
87
|
-
# ---------------------------------------------------------------------------------------
|
|
88
|
-
|
|
89
|
-
# Add action in a sequence with
|
|
90
|
-
# - action name
|
|
91
|
-
# - reference to the function implementing it
|
|
92
|
-
# - inputParameterNames - list of names that hold input parameters
|
|
93
|
-
def addActionAsFunctionWithInputParams(self, funcRef, actionName, inputParameterNames=None):
|
|
94
|
-
action = {
|
|
95
|
-
'name': actionName,
|
|
96
|
-
'funcRef': funcRef,
|
|
97
|
-
'inputParameterNames': inputParameterNames
|
|
98
|
-
}
|
|
99
|
-
self.flow.append(action)
|
|
100
|
-
# print(len(self.flow))
|
|
101
|
-
return self
|
|
102
|
-
|
|
103
|
-
def runWithDescriptiveMultiDataFlow(self, dataName, dataIn):
|
|
104
|
-
print("---")
|
|
105
|
-
self.results = {}
|
|
106
|
-
self.results[dataName] = dataIn
|
|
107
|
-
for action in self.flow:
|
|
108
|
-
# print("running action: ", action)
|
|
109
|
-
print("running action: ", action['name'])
|
|
110
|
-
func = action['funcRef']
|
|
111
|
-
inputParameterNames = action['inputParameterNames']
|
|
112
|
-
inputParameters = []
|
|
113
|
-
for inputParameterName in inputParameterNames:
|
|
114
|
-
inputParameters.append(self.results[inputParameterName])
|
|
115
|
-
result = func(*inputParameters)
|
|
116
|
-
self.results[action['name']] = result
|
|
117
|
-
print("result: ", result)
|
|
118
|
-
print("---")
|
|
119
|
-
|
|
120
|
-
# ---------------------------------------------------------------------------------------
|
|
121
|
-
# NOTE: DESCRIPTIVE_MULTIDATAOUTPUT_FLOW: output data flow can have multiple datasets
|
|
122
|
-
# each with its own name
|
|
123
|
-
# ---------------------------------------------------------------------------------------
|
|
124
|
-
|
|
125
|
-
# Add action in a sequence with
|
|
126
|
-
# - action name
|
|
127
|
-
# - reference to the function implementing it
|
|
128
|
-
# - inputParameterNames - list of names that hold input parameters
|
|
129
|
-
def addActionAsFunctionWithOutputParams(self, funcRef, actionName, inputParameterNames=None, outputParameterNames=None):
|
|
130
|
-
action = {
|
|
131
|
-
'name': actionName,
|
|
132
|
-
'funcRef': funcRef,
|
|
133
|
-
'inputParameterNames': inputParameterNames,
|
|
134
|
-
'outputParameterNames': outputParameterNames
|
|
135
|
-
}
|
|
136
|
-
self.flow.append(action)
|
|
137
|
-
# print(len(self.flow))
|
|
138
|
-
return self
|
|
139
|
-
|
|
140
|
-
def runWithDescriptiveOutDataFlow(self, dataName, dataIn):
|
|
141
|
-
print("---")
|
|
142
|
-
self.results = {}
|
|
143
|
-
self.results[dataName] = dataIn
|
|
144
|
-
for action in self.flow:
|
|
145
|
-
# print("running action: ", action)
|
|
146
|
-
print("running action: ", action['name'])
|
|
147
|
-
func = action['funcRef']
|
|
148
|
-
inputParameterNames = action['inputParameterNames']
|
|
149
|
-
inputParameters = []
|
|
150
|
-
for inputParameterName in inputParameterNames:
|
|
151
|
-
inputParameters.append(self.results[inputParameterName])
|
|
152
|
-
outputParameterNames = action['outputParameterNames']
|
|
153
|
-
result = func(*inputParameters)
|
|
154
|
-
if outputParameterNames != None and len(outputParameterNames)>1:
|
|
155
|
-
results = result
|
|
156
|
-
print("results: ", results)
|
|
157
|
-
if(len(outputParameterNames) != len(results)):
|
|
158
|
-
print("Expected number of parameters: %s, but got %s instead" %
|
|
159
|
-
(len(outputParameterNames), len(results)))
|
|
160
|
-
for i in range(len(outputParameterNames)):
|
|
161
|
-
outputParameterName = outputParameterNames[i]
|
|
162
|
-
result = results[i]
|
|
163
|
-
self.results[outputParameterName] = result
|
|
164
|
-
print("result[%s]: %s" % (i, result))
|
|
165
|
-
else:
|
|
166
|
-
print("result: ", result)
|
|
167
|
-
self.results[action['name']] = result
|
|
168
|
-
print("---")
|