@rbbn/distant-werkout-main
v1.3.0
Published
Provides an implementation of Distant Werkout to be used in the main process of an Electron application. This implementation handles IPC messages from the Renderer process as follows:
Downloads
1
Readme
Distant Werkout Main
Provides an implementation of Distant Werkout to be used in the main process of an Electron application. This implementation handles IPC messages from the Renderer process as follows:
1. renderReady
- procures Electron window
- Message of type 'main' is sent to Renderer with the following payload:
- { type: 'info', data: 'Ack' }
2. sdkMessage
- Message is forwarded to the remote application
2. showWindow
- Message is forwarded to the remote application
4. moveWindow
- Message is forwarded to the remote application
5. setLogForwarding
- Message is forwarded to the remote application
6. setupVDI
- VDI initialization is requested (virtual channel is opened and controller is created)
- Message of type 'setupVDIFinished' is sent to Renderer with the following payload:
- { type: 'info', initialized: , moduleName: }
7. createSession
- A new session is requested with the ID provided
8. closeSession
- A close session request will be issued for a session matching the ID provided
9. refresh
- Message is forwarded to the remote application as type 'reload'
10. callTestFinished
- Distant sessions are closed
- Virtual channel handle is destroyed
- Electron application exits
11. getChannel
- Accepts an object with a 'name' property
- Sends an IPC message of event 'getChannelFinish' with the Virtual Channel handle matching the name
12. testsFinish
- Forwards test results to the Distant Werkout Daemon
- Allows for test results to be sent to the Werkout server through the Distant Werkout Daemon's partner state
13. shutdown
- Shuts down VDI:
- close all sessions
- destroy handle to virtual channel
- Sends a 'shutdownFinish' message to the renderer process
Usage
const main = require('distant-werkout-main')
const url = 'https://example/my/remote/application'
const distantWerkoutMain = main(url)