Skip to content

Commit 1a69010

Browse files
committed
Change logs:
1. Rebrand products 2. Add disclamer 3. Update links 4. Fix typo
1 parent 2e91a53 commit 1a69010

5 files changed

Lines changed: 41 additions & 17 deletions

File tree

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# Refinitiv Real-time WebSocket API with Web Workers Example
2+
3+
- Last update: Jan 2021
4+
- Environment: Any
5+
- Compiler: JavaScript
6+
- Prerequisite: Refinitiv Real-Time Advanced Data Hub and Refinitiv Real-Time Advanced Distribution servers version 3.2.1 and above
7+
28
## Overview
39

4-
[Refinitiv Real-time WebSocket API](https://developers.refinitiv.com/elektron/websocket-api) (formerly known as Elektron WebSocket API) enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your Refinitiv Real-Time infrastructure and presents data in an open (JSON) readable format. The API supports all Refinitiv Real-Time data models and can be integrated into multiple client technology standards e.g. Python, R, .Net etc.
10+
[Websocket API for Pricing Streaming and Real-Time Service](https://developers.refinitiv.com/en/api-catalog/elektron/refinitiv-websocket-api) aka Websocket API application enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your Refinitiv Real-Time infrastructure and presents data in an open (JSON) readable format. The API supports all Refinitiv Real-Time data models and can be integrated into multiple client technology standards e.g. Python, R, .Net, etc.
511

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).
12+
The web browser's JavaScript runtime is a single-threaded environment by default. However, the HTML standard lets developers implement multi-threads JavaScript application in the web browser by introducing the [Web Workers](https://html.spec.whatwg.org/multipage/workers.html) feature that lets web browsers run JavaScripts in the main thread and a background thread (workers thread).
713

8-
This example shows how to implement the Refinitiv Real-time WebSocket API with JavaScript web application with Web Workers. It allows the Web Workers thread to handle the connection logic with ADS server while the main thread handles the UI interaction events and displaying data.
14+
This example shows how to implement the Refinitiv Real-time WebSocket API with JavaScript web application with Web Workers. It allows the Web Workers thread to handle the connection logic with eal-Time Advanced Distribution server while the main thread handles the UI interaction events and displaying data.
915

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 Refinitiv Real-time WebSocket API with JavaScript web browser application with Dedicated Workers.
16+
There are two types of 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 Refinitiv Real-time WebSocket API with JavaScript web browser application with Dedicated Workers.
1117

12-
*Note: The initial release of this API is for deployed ADS customers only (i.e. to use it you will need an installed version of ADS 3.2.1 and above).
18+
*Note: The initial release of this API is for deployed Refinitiv Real-Time Advanced Distribution Server customers only (i.e. to use it you will need an installed version of Refinitiv Real-Time Advanced Distribution Server 3.2.1 and above).
1319

1420
## Supported Web Browsers
15-
The example supports Chrome, Firefox and IE11 (based on the WebSocket and Web Workers browser supported platform).
21+
The example supports Chrome/Microsoft Edge (Chrome-based version), Firefox, and IE11 (based on the WebSocket and Web Workers browser supported platform).
1622

1723
## Prerequisite
18-
This example requires the following dependencies softwares.
24+
This example requires the following dependencies software.
1925
1. [Node.js](https://nodejs.org/en/) runtime - version 8.9.3 or higher.
2026
2. [npm](https://www.npmjs.com/) package manager (included with Node.js runtime)
2127
3. [Express.js](https://expressjs.com/) framework (will be installed via ```npm install``` command)
@@ -43,22 +49,24 @@ The web application contains the following example files and folder:
4349

4450
![npm command display](images/npm_install_2.png "npm command display")
4551

46-
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>```
47-
4. Run ```$> node server.js``` in the command prompt to start the web server at HTTP port 8080
52+
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 a command prompt: ```set https_proxy=http://<proxy.server>:<port>```
53+
4. Run ```$> node server.js``` in the command prompt to start the webserver at HTTP port 8080
4854

4955
![application display](images/run_server_2.png "run server")
5056

51-
5. Open web browser (IE11, Chrome and Firefox), then navigate to index.html of the web server at ```http://localhost:8080/index.html```
57+
5. Open the web browser (IE11, Chrome/Microsoft Edge (Chrome-based version), and Firefox), then navigate to index.html of the web server at ```http://localhost:8080/index.html```
5258

5359
![application display](images/application_screen_2.png "application display")
5460

5561

5662
## References
63+
5764
For further details, please check out the following resources:
58-
* [Refinitiv Real-time WebSocket API page](https://developers.refinitiv.com/websocket-api) on the [Refinitiv Developer Community](https://developers.refinitiv.com/) web site.
65+
* [Refinitiv Real-Time & Distribution Family page](https://developers.refinitiv.com/en/use-cases-catalog/refinitiv-real-time) on the [Refinitiv Developer Community](https://developers.refinitiv.com/) web site.
66+
* [WebSocket API page](https://developers.refinitiv.com/en/api-catalog/elektron/refinitiv-websocket-api).
5967
* [Developer Webinar Recording: Introduction to Electron Websocket API](https://www.youtube.com/watch?v=CDKWMsIQfaw)
6068
* [Mozilla Developer Network: Web Workers API page](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
6169
* [Google HTML5 Rocks: The Basics of Web Workers page](https://www.html5rocks.com/en/tutorials/workers/basics/)
6270
* [Mozilla Developer Network: WebSocket API page](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
6371

64-
For any question related to this article or Refinitiv Real-time WebSocket API page, please use the Developer Community [Q&A Forum](https://community.developers.refinitiv.com/).
72+
For any question related to this example or WebSocket API, please use the Developer Community [Q&A Forum](https://community.developers.refinitiv.com/).

app/market_price_app.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
//|-----------------------------------------------------------------------------
2+
//| This source code is provided under the Apache 2.0 license --
3+
//| and is provided AS IS with no warranty or guarantee of fit for purpose. --
4+
//| See the project's LICENSE.md for details. --
5+
//| Copyright Refinitiv 2017. All rights reserved. --
6+
//|-----------------------------------------------------------------------------
7+
8+
19
//******************************************************************************************/
210
// The market_price_app.js is a main application file.
311
// It handles all UI interactions.
4-
// It sends and receives messages with ws_workers.js file to communicate with ADS WebSocket.
12+
// It sends and receives messages with ws_workers.js file to communicate with Refinitiv Real-Time Advanced Distribution Server WebSocket.
513

614
// Author: Wasin Waeosri
715
// Version: 1.0

app/ws_workers.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
//|-----------------------------------------------------------------------------
2+
//| This source code is provided under the Apache 2.0 license --
3+
//| and is provided AS IS with no warranty or guarantee of fit for purpose. --
4+
//| See the project's LICENSE.md for details. --
5+
//| Copyright Refinitiv 2017. All rights reserved. --
6+
//|-----------------------------------------------------------------------------
7+
8+
19
//******************************************************************************************/
210
// The ws_workers.js is an application Web Workers file.
3-
// It handles all communications with ADS WebSocket.
11+
// It handles all communications with Refinitiv Real-Time Advanced Distribution Server WebSocket.
412

513
// Author: Wasin Waeosri
614
// Version: 1.0

images/application_screen_2.png

15.4 KB
Loading

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8-
<title>ADS WebSocket Market Price Streaming Example</title>
8+
<title>WebSocket API Market Price Streaming Example</title>
99
<!-- Bootstrap Latest compiled and minified CSS -->
1010
<link rel="stylesheet" href="./bootstrap/css/bootstrap.min.css">
1111
<!-- Bootstrap Optional theme -->
@@ -27,10 +27,10 @@
2727
<body>
2828
<!-- WebSocket connection UI input form -->
2929
<div class="container-fluid">
30-
<h4>Refinitiv Real-time WebSocket API with Web Workers Example</h4>
30+
<h4>WebSocket API with Web Workers Example</h4>
3131
<form class="form-inline">
3232
<div class="form-group">
33-
<label for="txtServerurl">Server:</label> &nbsp; <input type="text" id="txtServerurl" placeholder="ADS IP:WebSocket Port" class="form-control">&nbsp;&nbsp;
33+
<label for="txtServerurl">Server:</label> &nbsp; <input type="text" id="txtServerurl" placeholder="Server IP:WebSocket Port" class="form-control">&nbsp;&nbsp;
3434
<button id="btnConnect" type="button" class="btn btn-sm btn-primary">Connect</button>
3535
</div>
3636
<br/><br/>

0 commit comments

Comments
 (0)