-
We have a general bunch of questions to the communication between GLSP-Client and Server:
original thread by Jonas Ebel |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
As an example for all three questions, you can look at: It gets the action dispatcher injected, dispatches an action (that is forwarded to the server -- see
|
Beta Was this translation helpful? Give feedback.
-
Note that in order to be able to get something injected, your class needs to be bound in the dependency injection container: https://github.com/eclipsesource/graphical-lsp/blob/master/client/packages/sprotty-client/src/features/context-menu/di.config.ts |
Beta Was this translation helpful? Give feedback.
-
On the server, you have to register an action handler that is responsible for processing the incoming actions and, in your use case, would send an action back. See for instance: |
Beta Was this translation helpful? Give feedback.
-
[Jonas Ebel] Hey Philipp this helped me a lot - I have one follow up question: |
Beta Was this translation helpful? Give feedback.
-
Hi Jonas, |
Beta Was this translation helpful? Give feedback.
-
[Jonas Ebel] I was further analysing the action flow for message, which where dispatched. I saw that the issue, that the action, returned from the server was not fired again at the server, is that the method handleLocally in sprotty/model does exclude Actions to be fired again at the server, when they originate from the server. |
Beta Was this translation helpful? Give feedback.
-
[Jonas Ebel] The issue I am trying to solve is in ecore-glsp eclipsesource/ecore-glsp#47 |
Beta Was this translation helpful? Give feedback.
-
On server side we use an |
Beta Was this translation helpful? Give feedback.
-
You can simply inject the |
Beta Was this translation helpful? Give feedback.
-
[Jonas Ebel] Thanks again - so I understand there is no action queueing for 'locally' fired actions on the glsp server? Only direct synchronous calls are possible here? |
Beta Was this translation helpful? Give feedback.
-
Yes you are correct. This is a know limitation of the current ´ActionProcessor' implementation. However you can work around this in your |
Beta Was this translation helpful? Give feedback.
Yes you are correct. This is a know limitation of the current ´ActionProcessor' implementation. However you can work around this in your
ActionHandler
implementation by dispatching your response action over the 'ActionProcessor' again.In a nutshell:
Synchrous direct response-> Return your response action in the execute method of your `ActionHandler implementation
Asynchronous response -> Dispatch/send your response action over the 'ActionProcessor' and return an empty Optional.