You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,30 @@
1
1
# Elektron WebSocket API with Web Workers Example
2
2
## Overview
3
3
4
-
[Elektron WebSocket API](https://developers.thomsonreuters.com/elektron/websocket-api) enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your TREP infrastructure or the Thomson Reuters platform and presents data in an open (JSON) readable format. The API supports all Thomson Reuters Elektron data models and can be integrated into multiple client technology standards e.g. Python, R, .Net etc.
4
+
[Elektron WebSocket API](https://developers.thomsonreuters.com/websocket-api) enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your TREP infrastructure or the Thomson Reuters platform and presents data in an open (JSON) readable format. The API supports all Thomson Reuters Elektron data models and can be integrated into multiple client technology standards e.g. Python, R, .Net etc.
5
5
6
6
The web browsers JavaScript runtime is a single-threaded environment by default. However, the HTML standard lets developers implement multi threads JavaScript application in web browser by introducing the [Web Workers](https://html.spec.whatwg.org/multipage/workers.html) feature that lets web browsers run JavaScripts in a main thread and a background thread (workers thread).
7
7
8
8
This example shows how to implement the Elektron WebSocket API with JavaScript web application with Web Workers. It lets the Web Workers thread handles a connection logic with ADS WebSocket while the main thread handles the UI interaction events and displaying data.
9
9
10
10
There are two types of the Web Workers, [Dedicated Workers](https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface) and [Shared Workers](https://html.spec.whatwg.org/multipage/workers.html#sharedworker). This example covers only how to implement the Elektron WebSocket API with JavaScript web browser application with Dedicated Workers.
11
11
12
+
*Note: The initial release of this API is for deployed TREP customers only (i.e. to use it you will need an installed version of TREP 3.2).
13
+
12
14
## Supported Web Browsers
13
15
The example supports Chrome, Firefox and IE11 (based on the WebSocket and Web Workers browser supported platform).
14
16
15
17
## Prerequisite
16
-
This example uses the following 3rd party libraries.
18
+
This example requires the following dependencies softwares.
19
+
1.[Node.js](https://nodejs.org/en/) - version 6.10 or higher.
20
+
2.[npm](https://www.npmjs.com/) package manager (included in Node.js)
21
+
3.[Express.js](https://expressjs.com/) framework
22
+
23
+
This example also uses the following 3rd party libraries for UI presentation.
Both of jQuery and Bootstrap are distributed under the [MIT license](https://opensource.org/licenses/MIT). Please see more detail in the LICENSE.md file.
27
+
jQuery,Bootstrap and Express.js are distributed under the [MIT license](https://opensource.org/licenses/MIT). Please see more detail in the LICENSE.md file.
21
28
22
29
## Example files and folders
23
30
The web application contains the following example files and folder:
@@ -27,14 +34,29 @@ The web application contains the following example files and folder:
27
34
4. css/cover.css: The application CSS file
28
35
5. libs/jquery-3.2.1.min.js: jQuery library file
29
36
6. bootstrap/css, bootstarp/fonts and bootstrap/js folders: The folders for Bootstrap CSS and libraries files
37
+
7. node_modules folder: Folder for Node.js and Express.js modules for web server running
38
+
8. server.js: A web server application
39
+
9. package.json: The Project npm dependencies file.
30
40
31
41
## How to run this example
32
-
1. Deploy the project in any web server (recommend [http-server](https://www.npmjs.com/package/http-server) for quick dev/testing)
33
-
2. Open <webserver>/index.html in the web browsers (IE11, Chorme and Firefox)
42
+
1. Unzip or download the example project folder into a directory of your choice
43
+
2. Run ```$> npm install``` in the command prompt to install all the dependencies required to run the sample in a subdirectory called *node_modules/*.
3. If the machine is behind a proxy server, you need to configure Node.js uses proxy instead of a direct HTTP connection via the following command in command prompt: ```set https_proxy=http://<proxy.server>:<port>```
48
+
4. Run ```$> node server.js``` in the command prompt to start the web server at HTTP port 3000
For further details, please check out the following resources:
37
-
*[Thomson Reuters Elektron WebSocket API page](https://developers.thomsonreuters.com/elektron/websocket-api) on the [Thomson Reuters Developer Community](https://developers.thomsonreuters.com/) web site.
59
+
*[Thomson Reuters Elektron WebSocket API page](https://developers.thomsonreuters.com/websocket-api) on the [Thomson Reuters Developer Community](https://developers.thomsonreuters.com/) web site.
38
60
*[Mozilla Developer Network: Web Workers API page](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
39
61
*[Google HTML5 Rocks: The Basics of Web Workers page](https://www.html5rocks.com/en/tutorials/workers/basics/)
0 commit comments