Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update config for RPC communication #6613

Closed
ishantiw opened this issue Aug 4, 2021 · 0 comments
Closed

Update config for RPC communication #6613

ishantiw opened this issue Aug 4, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Aug 4, 2021

Description

Update the Configuration to improve and handle multiple mode of RPC communication.

// Current Config
rpc: {
	mode: ipc | ws,
 	enable: true,
	port: 8080,
}

// In Bus constructor
// Problem: It starts IPC server anyways even if ipc mode is not chosen
if (this.config.rpc.enable) {
            this._ipcServer = new IPCServer({
                socketsDir: this.config.socketsPath.root,
                name: 'bus',
            });
  }

if (this.config.rpc.enable && this.config.rpc.mode === 'ws') {
			this._wsServer = new WSServer({
				path: '/ws',
				port: config.rpc.port,
				host: config.rpc.host,
				logger: this.logger,
			});
		}
// New Config
rpc: {
	ipc: { path: ‘tmp/external/},
 	ws: { port: 8080 },
        modes: [‘ipc’, ‘ws’]
}

// In Bus constructor
if (this.config.rpc.ipc) {
            this._ipcServer = new IPCServer({
                socketsDir: this.config.socketsPath.root,
                name: 'bus',
            });
  }

if (this.config.rpc.ws) {
            this._wsServer = new WSServer({
                path: '/ws',
                port: config.rpc.port,
                host: config.rpc.host,
                logger: this.logger,
            });
  }

Acceptance Criteria

  • Config related tests should pass
  • Should be able to run current ws, ipc modes concurrently

Additional Information

Related #6612

@ishantiw ishantiw changed the title Update config for API communication Update config for RPC communication Aug 5, 2021
@nazarhussain nazarhussain self-assigned this Aug 9, 2021
ishantiw added a commit that referenced this issue Aug 11, 2021
Update config for RPC communication - Closes #6613
@shuse2 shuse2 closed this as completed Aug 11, 2021
@sridharmeganathan sridharmeganathan added this to the Sprint 50 milestone Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants