-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve how we retry the websocket connection (#1118)
* Make websocket connection retry forever for remote as well. And show an error message when there have been too many retries. * Allow CORS for localhost when using node (required for things like /healthz checks) and remove unused check_origin method from request handlers (it only exists for WebSocketHandlers). * Convert Resolver to TS * Make WebsocketConnection ping via HTTP, and simplify FSM. * Add docs/examples on how to run streamlit reports on AWS nvidia-docker (#1065) * Add benchmark.py from https://databricks.com/tensorflow/using-a-gpu * Make tensorflow not gobble up all the GPU memory. * Add docker gpu example code. * Add more Dockerfile comments. * Turn into streamlit report. * Add docs * Make network errors not clear out the whole report. * Comment * Remove unused number arg from onConnectionStateChange. * Rename * Return successful uri index after ping. * Comment. * Comment. * Rename * Add ping to Websocket. Also other Tornado settings, like better size limit. * Show useful error message when connection fails. * Change a single word in an error message * [Fix #1097] Use secure websockets when https * Allow WS CORS from non-localhost when using Node. * Improve error handling / timeout handling. * Renames and comments. * Fix comments from kantuni
- Loading branch information
Showing
11 changed files
with
617 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @license | ||
* Copyright 2018 Streamlit Inc. All rights reserved. | ||
*/ | ||
|
||
|
||
/** | ||
* A promise wrapper that makes resolve/reject functions public. | ||
*/ | ||
export default class Resolver<T> { | ||
public resolve: (arg?: T) => (void|Promise<any>) | ||
public reject: (reason?: any) => (void|Promise<any>) | ||
public promise: Promise<T> | ||
|
||
public constructor() { | ||
// Initialize to something so TS is happy. | ||
this.resolve = () => {} | ||
this.reject = () => {} | ||
|
||
this.promise = new Promise<T>((resFn, rejFn) => { | ||
this.resolve = resFn | ||
this.reject = rejFn | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.