forked from noflo/noflo-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msgflo.yaml
104 lines (95 loc) · 2.6 KB
/
msgflo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
runtimetypes:
msgflo:
shortname: MsgFlo Message Queuing
icon: cubes
description: 'Message queue orchestration'
helpurl: 'https://msgflo.org/docs/usage/'
preferredlanguage: python
componenttemplates:
python: |
#!/usr/bin/env python
import msgflo
class <%= name %>(msgflo.Participant):
def __init__(self, role):
d = {
'component': '<%= namespace %>/<%= name %>',
'label': '<%= description %>',
'icon': '<%= icon %>',
'inports': [
{ 'id': 'in', 'type': 'any' },
],
'outports': [
{ 'id': 'out', 'type': 'any' },
],
}
msgflo.Participant.__init__(self, d, role)
def process(self, inport, msg):
self.send('out', msg.data)
self.ack(msg)
if __name__ == '__main__':
msgflo.main(<%= name %>)
coffeescript: |
# To work in msgflo-nodejs source tree
try
msgflo = require 'msgflo-nodejs'
catch e
msgflo = require '..'
<%= name %> = (client, role) ->
definition =
component: '<%= namespace %>/<%= name %>'
icon: '<%= icon %>'
label: '<%= description %>'
inports: [
id: 'in'
type: 'any'
]
outports: [
id: 'out'
type: 'any'
]
process = (inport, indata, callback) ->
return callback 'out', null, indata
return new msgflo.participant.Participant client, definition, process, role
module.exports = <%= name %>
javascript: |
try {
var msgflo = require('msgflo-nodejs');
} catch (error) {
var e = error;
var msgflo = require('..');
}
var <%= name %> = function(client, role) {
var definition = {
component: '<%= namespace %>/<%= name %>',
icon: '<%= icon %>',
label: '<%= description %>',
inports: [
{
id: 'in',
type: 'any'
}
],
outports: [
{
id: 'out',
type: 'any'
}
]
};
var process = function(inport, indata, callback) {
return callback('out', null, indata);
};
return new msgflo.participant.Participant(client, definition, process, role);
};
module.exports = <%= name %>;
yaml: |
# Declare MsgFlo participant on behalf of code which does not send discovery message by itself
component: '<%= namespace %>/<%= name %>'
label: '<%= description %>'
icon: '<%= icon %>'
inports:
open:
queue: /bitraf/door/#ROLE/open
type: object
outports: {}
examples: {}