How to push messages from backend to output channel

I have a json-rpc stream I/O server based on python, I am connecting with it using backend node services.

How can I push the Notification messages coming from the python server to the Output channel,

when i tried injecting outputChannel in backend node services , theia-ide doesn’t start.

Do you have any example , how to push messages to outputchannel from backend services.

@chakraborty-slx thank you for the discussion, I believe it should work but due to it is currently not possible to import the OutputChannelManager in the backend (node). We will have to address the problem first. You could however communicate to browser code that imports the manager and it will write to the channel.

@vince-fugnitto i found this repo, I am not sure whether this is the right approach
Here server is sending events to the clients. Using this approach , I can add a
rpcConnection.onNotification(logNotificationType, this.logNotifactionHandler);

and then

logNotifactionHandler: NotificationHandler = async (params: LogParams) => {
this.client.onChange(params.level, params.message);

@chakraborty-slx I’m not aware of the example repository you referenced, it is also quite old.

I believe you can start off with the backend example of our generator which should have in place the mechanism for the frontend and backend to communicate, and from which you implement your use-case.

@vince-fugnitto let me try this approach. thanks again.

1 Like