SlideShare a Scribd company logo
Copyright © 2016 M/Gateway Developments Ltd
EWD 3 Training Course
Part 6
What Happens when a QEWD
Application is Started
Rob Tweed
Director, M/Gateway Developments Ltd
Twitter: @rtweed
Copyright © 2016 M/Gateway Developments Ltd
QEWD Application Startup
• Triggered by EWD.start() function in
ewd-client
– Creates the client environment
• Everything protected within a closure
– Establishes a web socket connection to QEWD back-
end
– Registers the client application within QEWD
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
Caché,
GT.M or
Redis
EWD.start()
Master
process
Worker
process
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
Browser makes web-socket connection
to back-end
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
Browser sends
WebSocket message
type: ‘ewd-register’
application: ‘demo1’
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
Message queued
and passed
to available worker
type: ‘ewd-register’
application: ‘demo1’
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
New QEWD Session
created
application: ‘demo1’
ewd-session
Stored in global named
'CacheTempEWDSession'
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
New session token returned, eg:
token: ‘a0a033a9-393a-4e7a-9252-848c24ee5b02’
ewd-session Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
Token returned to browser
token: ‘a0a033a9-393a-4e7a-9252-848c24ee5b02’
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
Token stored within
Closure in browser
Accessible by ewd-client
APIs but not by user
token
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Application registration
Browser QEWD
socket.io
socket.io
token
Registration completed
ewd-registered event fires
Caché,
GT.M or
Redis
Copyright © 2016 M/Gateway Developments Ltd
Examine activity in back-end
• Look at Command Prompt or terminal
window in which you're running QEWD:
Should look something like this:
worker 3884 received message: {"type":"ewd-register","application":"demo1","sock
etId":"/#oIQ1LbMUlKew3RefAAAE"}
master process received response from worker 3884: {"type":"ewd-register","finis
hed":true,"message":{"token":"a0a033a9-393a-4e7a-9252-848c24ee5b02"}}
*** handleMessage response {"type":"ewd-register","finished":true,"message":{"to
ken":"a0a033a9-393a-4e7a-9252-848c24ee5b02"}}
sending to socket /#oIQ1LbMUlKew3RefAAAE
Master process has finished processing response from worker process 3884 which i
s back in available pool
Copyright © 2016 M/Gateway Developments Ltd
Examine activity in back-end
worker 3884 received message:
{
"type":"ewd-register",
"application":"demo1",
"socketId":"/#oIQ1LbMUlKew3RefAAAE”
}
Let's examine some of those QEWD log messages
(formatted for clarity)
QEWD / ewd-qoper8 worker process was passed the message object
- Message type was 'ewd-register', for an application named 'demo1'
- SocketId is the unique web-socket Id for the client that sent the message
Copyright © 2016 M/Gateway Developments Ltd
Examine activity in back-end
master process received response from worker 3884:
{
"type":"ewd-register",
"finished":true,
"message":{
"token":"a0a033a9-393a-4e7a-9252-848c24ee5b02”
}
}
QEWD / ewd-qoper8 worker process finished processing the request
- Returned its response object to the ewd-qoper8 master process
- Message/response type is 'ewd-register'
- Token contains the QEWD session token
Copyright © 2016 M/Gateway Developments Ltd
Examine activity in back-end
sending to socket /#oIQ1LbMUlKew3RefAAAE
QEWD returns the response object to the awaiting browser, via
the web-socket connection identified by the socketId
Copyright © 2016 M/Gateway Developments Ltd
Examine activity in back-end
Master process has finished processing response
from worker process 3884 which is back in available pool
The ewd-qoper8 worker process has completed its processing, and
the master process has completed handling the response object, so
the worker process is returned to the available pool, ready to handle
another incoming request.
Copyright © 2016 M/Gateway Developments Ltd
QEWD is Now Ready for your App
• Registration is complete:
– Browser has a session token
– Back-end has a session indexed by that token
• Now let’s begin building out our
application’s dynamic behaviour
– See Part 7

More Related Content

PDF
EWD 3 Training Course Part 29: Running QEWD as a Service
PDF
EWD 3 Training Course Part 12: QEWD Session Timeout Control
PDF
EWD 3 Training Course Part 7: Applying the QEWD Messaging Pattern
PDF
EWD 3 Training Course Part 35: QEWD Session Locking
PDF
EWD 3 Training Course Part 8: Anatomy of the QEWD Messaging Cycle
PDF
EWD 3 Training Course Part 27: The QEWD Session
PDF
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
PDF
EWD 3 Training Course Part 5a: First Steps in Building a QEWD Application
EWD 3 Training Course Part 29: Running QEWD as a Service
EWD 3 Training Course Part 12: QEWD Session Timeout Control
EWD 3 Training Course Part 7: Applying the QEWD Messaging Pattern
EWD 3 Training Course Part 35: QEWD Session Locking
EWD 3 Training Course Part 8: Anatomy of the QEWD Messaging Cycle
EWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
EWD 3 Training Course Part 5a: First Steps in Building a QEWD Application

What's hot (20)

PDF
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
PDF
EWD 3 Training Course Part 3: Summary of EWD 3 Modules
PDF
EWD 3 Training Course Part 19: The cache.node APIs
PDF
EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...
PDF
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
PDF
EWD 3 Training Course Part 11: Handling Errors in QEWD
PDF
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
PDF
EWD 3 Training Course Part 5b: First Steps in Building a QEWD Application
PDF
EWD 3 Training Course Part 34: QEWD Resilient Mode
PPT
EWD 3 Training Course Part 31: Using QEWD for Web and REST Services
PDF
EWD 3 Training Course Part 30: Modularising QEWD Applications
PPT
EWD 3 Training Course Part 45: Using QEWD's Advanced MicroService Functionality
PPT
EWD 3 Training Course Part 44: Creating MicroServices with QEWD.js
PDF
EWD 3 Training Course Part 4: Installing & Configuring QEWD
PPT
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
PPT
QEWD.js, JSON Web Tokens & MicroServices
PDF
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
PDF
qewd-ripple: The Ripple OSI Middle Tier
PDF
NodeJS : Communication and Round Robin Way
PPT
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 3: Summary of EWD 3 Modules
EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 11: Handling Errors in QEWD
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
EWD 3 Training Course Part 5b: First Steps in Building a QEWD Application
EWD 3 Training Course Part 34: QEWD Resilient Mode
EWD 3 Training Course Part 31: Using QEWD for Web and REST Services
EWD 3 Training Course Part 30: Modularising QEWD Applications
EWD 3 Training Course Part 45: Using QEWD's Advanced MicroService Functionality
EWD 3 Training Course Part 44: Creating MicroServices with QEWD.js
EWD 3 Training Course Part 4: Installing & Configuring QEWD
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
QEWD.js, JSON Web Tokens & MicroServices
EWD 3 Training Course Part 1: How Node.js Integrates With Global Storage Data...
qewd-ripple: The Ripple OSI Middle Tier
NodeJS : Communication and Round Robin Way
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
Ad

Viewers also liked (12)

PDF
EWD 3 Training Course Part 9: Complex QEWD Messages and Responses
PDF
EWD 3 Training Course Part 20: The DocumentNode Object
PDF
EWD 3 Training Course Part 13: Putting Everything so far into Practice using ...
PDF
EWD 3 Training Course Part 16: QEWD Services
PDF
EWD 3 Training Course Part 18: Modelling NoSQL Databases using Global Storage
PDF
EWD 3 Training Course Part 21: Persistent JavaScript Objects
PDF
EWD 3 Training Course Part 17: Introduction to Global Storage Databases
PDF
EWD 3 Training Course Part 33: Configuring QEWD to use CORS
PDF
EWD 3 Training Course Part 25: Document Database Capabilities
PDF
EWD 3 Training Course Part 24: Traversing a Document's Leaf Nodes
PDF
EWD 3 Training Course Part 26: Event-driven Indexing
PDF
EWD 3 Training Course Part 22: Traversing Documents using DocumentNode Objects
EWD 3 Training Course Part 9: Complex QEWD Messages and Responses
EWD 3 Training Course Part 20: The DocumentNode Object
EWD 3 Training Course Part 13: Putting Everything so far into Practice using ...
EWD 3 Training Course Part 16: QEWD Services
EWD 3 Training Course Part 18: Modelling NoSQL Databases using Global Storage
EWD 3 Training Course Part 21: Persistent JavaScript Objects
EWD 3 Training Course Part 17: Introduction to Global Storage Databases
EWD 3 Training Course Part 33: Configuring QEWD to use CORS
EWD 3 Training Course Part 25: Document Database Capabilities
EWD 3 Training Course Part 24: Traversing a Document's Leaf Nodes
EWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 22: Traversing Documents using DocumentNode Objects
Ad

Similar to EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started (20)

PDF
EWD 3 Training Course Part 2: EWD 3 Overview
PDF
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
PDF
NGINX Unit: Rebooting our Universal Web App Server
PDF
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
PDF
Microservices in AUTO1 by Alexander Egurtsov
PPTX
Consuming Restful APIs using Swagger v2.0
PDF
Docker on docker leveraging kubernetes in docker ee
PDF
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
PPT
Fiware io t_ul20_cpbr8
PDF
The Current And Future State Of Service Mesh
PDF
Intuit_payment_system_Craft_Demo_slide.pdf
PPTX
How to build Simple yet powerful API.pptx
PDF
Day In A Life Of A Node.js Developer
PDF
Day in a life of a node.js developer
PPTX
Sst hackathon express
PDF
Creating a Java Internet of Things Gateway
PPTX
APIs, STOP Polling, lets go Streaming
PDF
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
PDF
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
PPT
OGCE Project Overview
EWD 3 Training Course Part 2: EWD 3 Overview
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
NGINX Unit: Rebooting our Universal Web App Server
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Microservices in AUTO1 by Alexander Egurtsov
Consuming Restful APIs using Swagger v2.0
Docker on docker leveraging kubernetes in docker ee
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
Fiware io t_ul20_cpbr8
The Current And Future State Of Service Mesh
Intuit_payment_system_Craft_Demo_slide.pdf
How to build Simple yet powerful API.pptx
Day In A Life Of A Node.js Developer
Day in a life of a node.js developer
Sst hackathon express
Creating a Java Internet of Things Gateway
APIs, STOP Polling, lets go Streaming
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
OGCE Project Overview

More from Rob Tweed (9)

PDF
QEWD Update
PPT
Data Persistence as a Language Feature
PPT
LNUG: Having Your Node.js Cake and Eating It Too
PPT
QEWD.js: Have your Node.js Cake and Eat It Too
PPT
EWD 3 Training Course Part 42: The QEWD Docker Appliance
PDF
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
PDF
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
PDF
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
PDF
EWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPS
QEWD Update
Data Persistence as a Language Feature
LNUG: Having Your Node.js Cake and Eating It Too
QEWD.js: Have your Node.js Cake and Eat It Too
EWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPS

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
assetexplorer- product-overview - presentation
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
medical staffing services at VALiNTRY
PDF
System and Network Administraation Chapter 3
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PTS Company Brochure 2025 (1).pdf.......
How to Migrate SBCGlobal Email to Yahoo Easily
Operating system designcfffgfgggggggvggggggggg
Navsoft: AI-Powered Business Solutions & Custom Software Development
Design an Analysis of Algorithms I-SECS-1021-03
Wondershare Filmora 15 Crack With Activation Key [2025
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
assetexplorer- product-overview - presentation
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
CHAPTER 2 - PM Management and IT Context
medical staffing services at VALiNTRY
System and Network Administraation Chapter 3
Designing Intelligence for the Shop Floor.pdf
Transform Your Business with a Software ERP System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Internet Downloader Manager (IDM) Crack 6.42 Build 41

EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started

  • 1. Copyright © 2016 M/Gateway Developments Ltd EWD 3 Training Course Part 6 What Happens when a QEWD Application is Started Rob Tweed Director, M/Gateway Developments Ltd Twitter: @rtweed
  • 2. Copyright © 2016 M/Gateway Developments Ltd QEWD Application Startup • Triggered by EWD.start() function in ewd-client – Creates the client environment • Everything protected within a closure – Establishes a web socket connection to QEWD back- end – Registers the client application within QEWD
  • 3. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD Caché, GT.M or Redis EWD.start() Master process Worker process
  • 4. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io Browser makes web-socket connection to back-end Caché, GT.M or Redis
  • 5. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io Browser sends WebSocket message type: ‘ewd-register’ application: ‘demo1’ Caché, GT.M or Redis
  • 6. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io Message queued and passed to available worker type: ‘ewd-register’ application: ‘demo1’ Caché, GT.M or Redis
  • 7. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io New QEWD Session created application: ‘demo1’ ewd-session Stored in global named 'CacheTempEWDSession' Caché, GT.M or Redis
  • 8. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io New session token returned, eg: token: ‘a0a033a9-393a-4e7a-9252-848c24ee5b02’ ewd-session Caché, GT.M or Redis
  • 9. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io Token returned to browser token: ‘a0a033a9-393a-4e7a-9252-848c24ee5b02’ Caché, GT.M or Redis
  • 10. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io Token stored within Closure in browser Accessible by ewd-client APIs but not by user token Caché, GT.M or Redis
  • 11. Copyright © 2016 M/Gateway Developments Ltd Application registration Browser QEWD socket.io socket.io token Registration completed ewd-registered event fires Caché, GT.M or Redis
  • 12. Copyright © 2016 M/Gateway Developments Ltd Examine activity in back-end • Look at Command Prompt or terminal window in which you're running QEWD: Should look something like this: worker 3884 received message: {"type":"ewd-register","application":"demo1","sock etId":"/#oIQ1LbMUlKew3RefAAAE"} master process received response from worker 3884: {"type":"ewd-register","finis hed":true,"message":{"token":"a0a033a9-393a-4e7a-9252-848c24ee5b02"}} *** handleMessage response {"type":"ewd-register","finished":true,"message":{"to ken":"a0a033a9-393a-4e7a-9252-848c24ee5b02"}} sending to socket /#oIQ1LbMUlKew3RefAAAE Master process has finished processing response from worker process 3884 which i s back in available pool
  • 13. Copyright © 2016 M/Gateway Developments Ltd Examine activity in back-end worker 3884 received message: { "type":"ewd-register", "application":"demo1", "socketId":"/#oIQ1LbMUlKew3RefAAAE” } Let's examine some of those QEWD log messages (formatted for clarity) QEWD / ewd-qoper8 worker process was passed the message object - Message type was 'ewd-register', for an application named 'demo1' - SocketId is the unique web-socket Id for the client that sent the message
  • 14. Copyright © 2016 M/Gateway Developments Ltd Examine activity in back-end master process received response from worker 3884: { "type":"ewd-register", "finished":true, "message":{ "token":"a0a033a9-393a-4e7a-9252-848c24ee5b02” } } QEWD / ewd-qoper8 worker process finished processing the request - Returned its response object to the ewd-qoper8 master process - Message/response type is 'ewd-register' - Token contains the QEWD session token
  • 15. Copyright © 2016 M/Gateway Developments Ltd Examine activity in back-end sending to socket /#oIQ1LbMUlKew3RefAAAE QEWD returns the response object to the awaiting browser, via the web-socket connection identified by the socketId
  • 16. Copyright © 2016 M/Gateway Developments Ltd Examine activity in back-end Master process has finished processing response from worker process 3884 which is back in available pool The ewd-qoper8 worker process has completed its processing, and the master process has completed handling the response object, so the worker process is returned to the available pool, ready to handle another incoming request.
  • 17. Copyright © 2016 M/Gateway Developments Ltd QEWD is Now Ready for your App • Registration is complete: – Browser has a session token – Back-end has a session indexed by that token • Now let’s begin building out our application’s dynamic behaviour – See Part 7