pulse-sdk 1.0.8 → 1.0.9
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/producer.d.ts +1 -1
- package/dist/producer.js +2 -5
- package/dist/proto/pulse.proto +7 -1
- package/package.json +1 -1
package/dist/producer.d.ts
CHANGED
package/dist/producer.js
CHANGED
|
@@ -63,17 +63,14 @@ class Producer {
|
|
|
63
63
|
}
|
|
64
64
|
async streamSend(messages) {
|
|
65
65
|
return new Promise((resolve, reject) => {
|
|
66
|
-
const stream = this.client.StreamPublish((err,
|
|
66
|
+
const stream = this.client.StreamPublish((err, summary) => {
|
|
67
67
|
if (err)
|
|
68
68
|
return reject(err);
|
|
69
|
-
|
|
69
|
+
resolve(summary);
|
|
70
70
|
});
|
|
71
71
|
stream.on('error', (err) => {
|
|
72
72
|
reject(err);
|
|
73
73
|
});
|
|
74
|
-
stream.on('end', () => {
|
|
75
|
-
resolve();
|
|
76
|
-
});
|
|
77
74
|
for (const msg of messages) {
|
|
78
75
|
let data;
|
|
79
76
|
const headers = {};
|
package/dist/proto/pulse.proto
CHANGED
|
@@ -9,7 +9,7 @@ service PulseService {
|
|
|
9
9
|
rpc Publish(PublishRequest) returns (PublishResponse);
|
|
10
10
|
|
|
11
11
|
// StreamPublish sends a stream of messages to a topic.
|
|
12
|
-
rpc StreamPublish(stream PublishRequest) returns (
|
|
12
|
+
rpc StreamPublish(stream PublishRequest) returns (PublishSummary);
|
|
13
13
|
|
|
14
14
|
// Consume reads messages from a topic as a stream.
|
|
15
15
|
rpc Consume(ConsumeRequest) returns (stream ConsumeResponse);
|
|
@@ -35,6 +35,12 @@ message PublishResponse {
|
|
|
35
35
|
uint64 offset = 2;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
message PublishSummary {
|
|
39
|
+
uint64 succeeded_count = 1;
|
|
40
|
+
uint64 failed_count = 2;
|
|
41
|
+
string last_error = 3;
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
message ConsumeRequest {
|
|
39
45
|
string topic = 1;
|
|
40
46
|
string consumer_name = 2;
|