@opentap/runner-client 2.0.0-alpha.2.14 → 2.0.0-alpha.2.15
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/lib/BaseClient.js +12 -10
- package/package.json +1 -1
package/lib/BaseClient.js
CHANGED
|
@@ -197,7 +197,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
197
197
|
*/
|
|
198
198
|
BaseClient.prototype.sendChunked = function (subject, payload, options) {
|
|
199
199
|
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
-
var requestSubject, stringCodec, data, headers, opts, fileDescriptor, getChunk, message, i, response, jsonCodec;
|
|
200
|
+
var requestSubject, stringCodec, data, headers, opts, fileDescriptor, getChunk, dataSubject, message, i, response, jsonCodec;
|
|
201
201
|
return __generator(this, function (_a) {
|
|
202
202
|
switch (_a.label) {
|
|
203
203
|
case 0:
|
|
@@ -217,19 +217,21 @@ var BaseClient = /** @class */ (function () {
|
|
|
217
217
|
var offset = chunk * fileDescriptor.chunkSize;
|
|
218
218
|
return data.slice(offset, offset + fileDescriptor.chunkSize);
|
|
219
219
|
};
|
|
220
|
-
this.request(subject, fileDescriptor);
|
|
221
|
-
i = 0;
|
|
222
|
-
_a.label = 1;
|
|
220
|
+
return [4 /*yield*/, this.request(subject, fileDescriptor)];
|
|
223
221
|
case 1:
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
dataSubject = _a.sent();
|
|
223
|
+
i = 0;
|
|
224
|
+
_a.label = 2;
|
|
226
225
|
case 2:
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
if (!(i < fileDescriptor.numberOfChunks)) return [3 /*break*/, 5];
|
|
227
|
+
return [4 /*yield*/, this.connection.request(dataSubject, getChunk(i), opts)];
|
|
229
228
|
case 3:
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
message = _a.sent();
|
|
230
|
+
_a.label = 4;
|
|
232
231
|
case 4:
|
|
232
|
+
i++;
|
|
233
|
+
return [3 /*break*/, 2];
|
|
234
|
+
case 5:
|
|
233
235
|
if (message && message.data.length !== 0) {
|
|
234
236
|
jsonCodec = JSONCodec();
|
|
235
237
|
response = jsonCodec.decode(message.data);
|