rx-jupyter
Advanced tools
Comparing version 5.3.4 to 5.4.0
@@ -8,3 +8,2 @@ "use strict"; | ||
const ajax_1 = require("rxjs/ajax"); | ||
const operators_1 = require("rxjs/operators"); | ||
const webSocket_1 = require("rxjs/webSocket"); | ||
@@ -118,22 +117,2 @@ const url_join_1 = __importDefault(require("url-join")); | ||
}); | ||
wsSubject.pipe(operators_1.retryWhen(error$ => { | ||
// Keep track of how many times we've already re-tried | ||
let counter = 0; | ||
const maxRetries = 100; | ||
return error$.pipe(operators_1.tap(e => { | ||
counter++; | ||
// This will only retry on error when it's a close event that is not | ||
// from a .complete() of the websocket subject | ||
if (counter > maxRetries || e instanceof Event === false) { | ||
console.error(`bubbling up Error on websocket after retrying ${counter} times out of ${maxRetries}`, e); | ||
throw e; | ||
} | ||
else { | ||
// We'll retry at this point | ||
console.log("attempting to retry kernel connection after error", e); | ||
} | ||
}), operators_1.delay(1000)); | ||
}), | ||
// The websocket subject is multicast and we need the retryWhen logic to retain that property | ||
operators_1.share()); | ||
// Create a subject that does some of the handling inline for the session | ||
@@ -140,0 +119,0 @@ // and ensuring it's serialized |
{ | ||
"name": "rx-jupyter", | ||
"version": "5.3.4", | ||
"version": "5.4.0", | ||
"description": "RxJS 5 bindings for the Jupyter Notebook API", | ||
@@ -34,3 +34,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "3054fe966bd280c9b5d3ec40e0767f756a2a0cc1" | ||
"gitHead": "758bd220e8f30a21306fce5172caa83d881f446b" | ||
} |
import { Subject, Subscriber } from "rxjs"; | ||
import { ajax } from "rxjs/ajax"; | ||
import { delay, retryWhen, share, tap } from "rxjs/operators"; | ||
import { webSocket } from "rxjs/webSocket"; | ||
@@ -154,31 +153,2 @@ import urljoin from "url-join"; | ||
wsSubject.pipe( | ||
retryWhen(error$ => { | ||
// Keep track of how many times we've already re-tried | ||
let counter = 0; | ||
const maxRetries = 100; | ||
return error$.pipe( | ||
tap(e => { | ||
counter++; | ||
// This will only retry on error when it's a close event that is not | ||
// from a .complete() of the websocket subject | ||
if (counter > maxRetries || e instanceof Event === false) { | ||
console.error( | ||
`bubbling up Error on websocket after retrying ${counter} times out of ${maxRetries}`, | ||
e | ||
); | ||
throw e; | ||
} else { | ||
// We'll retry at this point | ||
console.log("attempting to retry kernel connection after error", e); | ||
} | ||
}), | ||
delay(1000) | ||
); | ||
}), | ||
// The websocket subject is multicast and we need the retryWhen logic to retain that property | ||
share() | ||
); | ||
// Create a subject that does some of the handling inline for the session | ||
@@ -185,0 +155,0 @@ // and ensuring it's serialized |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87549
2250