-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmanual_test.js
45 lines (34 loc) · 1.11 KB
/
manual_test.js
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
var pulsarnative = require('./index.js');
console.log("what's in the package", pulsarnative);
/*
pulsarnative.createApp(function(){
console.log(">>>> ",arguments);
});
*/
console.log('From native', pulsarnative.sum(40, 2));
var pulsar = pulsarnative.createPulsar();
console.log('From native', pulsar);
var producer = pulsarnative.createPulsarProducer(pulsar);
console.log('From native', producer);
pulsarnative.sendPulsarMessage(producer, {message:"It's a new message"});
pulsarnative.startPulsarConsumer(pulsar, function(){
console.log(">>>> ",arguments, "\n");
},{
});
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
console.log('plop de ready');
var asksend = function(){
rl.question('message to send to pulsar : ', function (m) {
pulsarnative.sendPulsarMessage(producer, {message : m});
asksend();
});
}
asksend();
rl.on('close', function () {
console.log('\nBYE BYE !!!');
process.exit(0);
});