Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to track the lifecycle of GLSP Client connections #96

Closed
CamilleLetavernier opened this issue Aug 13, 2020 · 2 comments
Closed
Assignees

Comments

@CamilleLetavernier
Copy link
Member

Currently, all injected elements in the GLSP Server are relying on garbage collection when they are no longer required. However, some injected members might have to manage some resources (e.g. Threads), and they need to know when to dispose these resources. There is currently no API for this

The Lifecycle API should:

  • Be available to any injected member of the GLSP Server module
  • Notify when a new clientId is created (i.e. a new GLSP widget for an existing client)
  • Notify when a clientId is removed (Widget disposed)
  • Notify when a client disconnects (Tab closed)

Note that the initial "client connection" triggers the injection, so we (probably) don't need a specific notification for that.

@tortmayr
Copy link
Contributor

Note that the initial "client connection" triggers the injection, so we (probably) don't need a specific notification for that.

I'm wondering if this LifeCycleAPI should actually be injected. Wouldn't it be better to have a global life cycle manager that can also track all connected clients (actual clients not clientIds). If so, this manager would either have to be singleton or we have to parent injector (one per server).

@CamilleLetavernier
Copy link
Member Author

The Lifecycle itself doesn't have to be created through injection; but it can still be injected through each module.

Even if the Lifecycle is a singleton, we still probably don't need a specific notification for client connection, because injected elements will be created after the client has connected (i.e. the client will connect before any injected instance will have a chance to install a listener on the Lifecycle)

tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 24, 2020
- Refactor client-server communication into a base protocol and a jsonrpc specific implementation (#94)
- Cleanup protocol and implement (previously unused) shutdown method
- Add ClientSessionManager to track lifecycle of GLSP client connections (#96)
- Add listener-mechanism to react to lifecycle changes (used in 
DefaultModelStateProvider)
- Remove (now obsolete) GLSPClientProxyProvider
- Fix wrong version of guava in org.eclipse.glsp.graph pom.xml
- Add unique applicationId to InitializeParameters

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Aug 24, 2020
- Clean up communication and move implementation into glsp client
- Define a "clean" `GLSPClient` interface that is independent from the underlying communication protocol
- Provide a base implementation for a jsonrpc-based `GLSPClient`
- Update dependencies to sprotty 0.9.0
- Align dependency versions with Theia versions
- Add new DisposeClientAction to notify the server if a specific diagram client/widget can be disposed (e.g. on editor tab close)

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Aug 24, 2020
- Remove deprecated glsp client protcol and reuse the new API provided by @eclipse-glsp/client (#94 #96)
- Update dependencies to align with sprotty 0.9.0 and Theia 1.3.0. (104)
- Refactor glsp contributions to avoid dependencies on the (now deprecated) @theia/language module (#105)
- Provide a dedicated TheiaGLSPClient that uses the MessageService to propagate connection errors. (#39)
- Use unique application id in widgetId.

Requires: eclipse-glsp/glsp-client/pull/79

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
- eclipse-glsp/glsp/issues/105
- eclipse-glsp/glsp/issues/39
tortmayr added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Aug 24, 2020
- Remove deprecated glsp client protcol and reuse the new API provided by @eclipse-glsp/client (#94 #96)
- Update dependencies to align with sprotty 0.9.0 and Theia 1.3.0. (104)
- Refactor glsp contributions to avoid dependencies on the (now deprecated) @theia/language module (#105)
- Provide a dedicated TheiaGLSPClient that uses the MessageService to propagate connection errors. (#39)
- Use unique application id in widgetId.

Requires: eclipse-glsp/glsp-client/pull/79

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
- eclipse-glsp/glsp/issues/105
- eclipse-glsp/glsp/issues/39
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 24, 2020
- Refactor client-server communication into a base protocol and a jsonrpc specific implementation (#94)
- Cleanup protocol and implement (previously unused) shutdown method
- Add ClientSessionManager to track lifecycle of GLSP client connections (#96)
- Add listener-mechanism to react to lifecycle changes (used in 
DefaultModelStateProvider)
- Remove (now obsolete) GLSPClientProxyProvider
- Fix wrong version of guava in org.eclipse.glsp.graph pom.xml
- Add unique applicationId to InitializeParameters

Part of:
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 24, 2020
- Refactor client-server communication into a base protocol and a jsonrpc specific implementation (#94)
- Cleanup protocol and implement (previously unused) shutdown method
- Add ClientSessionManager to track lifecycle of GLSP client connections (#96)
- Add listener-mechanism to react to lifecycle changes (used in 
DefaultModelStateProvider)
- Remove (now obsolete) GLSPClientProxyProvider
- Fix wrong version of guava in org.eclipse.glsp.graph pom.xml
- Add unique applicationId to InitializeParameters

Part of:
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this issue Aug 24, 2020
-Update dependencies to conform to sprotty 0.9.0 and Theia 1.3.0
- Adapt code to confrom to client/server changes
- Change argument for passing the server port to "WF_GLSP"

Requires: 
- eclipse-glsp/glsp-server/pull/73
- eclipse-glsp/glsp-theia-integration/pull/44

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
- eclipse-glsp/glsp/issues/105
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Aug 25, 2020
* #94 #104 #96  Clean up communication protocol 

- Clean up communication and move implementation into glsp client
- Define a "clean" `GLSPClient` interface that is independent from the underlying communication protocol
- Provide a base implementation for a jsonrpc-based `GLSPClient`
- Update dependencies to sprotty 0.9.0
- Align dependency versions with Theia versions
- Add new DisposeClientAction to notify the server if a specific diagram client/widget can be disposed (e.g. on editor tab close)

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96

* Fix minors

* Adapt copyright headers

Co-authored-by: Philip Langer <planger@eclipsesource.com>
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 25, 2020
* #96 #94 Cleanup and refactor client-server communication

- Refactor client-server communication into a base protocol and a jsonrpc specific implementation (#94)
- Cleanup protocol and implement (previously unused) shutdown method
- Add ClientSessionManager to track lifecycle of GLSP client connections (#96)
- Add listener-mechanism to react to lifecycle changes (used in 
DefaultModelStateProvider)
- Remove (now obsolete) GLSPClientProxyProvider
- Fix wrong version of guava in org.eclipse.glsp.graph pom.xml
- Add unique applicationId to InitializeParameters

Part of:
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96

* Fix minors

* Adapt copyright headers and fix checkstyle warnings

Co-authored-by: Philip Langer <planger@eclipsesource.com>
tortmayr added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Aug 25, 2020
#44)

* #105 #104 #96 #94 #39 Cleanup and refactor client-server communication

- Remove deprecated glsp client protcol and reuse the new API provided by @eclipse-glsp/client (#94 #96)
- Update dependencies to align with sprotty 0.9.0 and Theia 1.3.0. (104)
- Refactor glsp contributions to avoid dependencies on the (now deprecated) @theia/language module (#105)
- Provide a dedicated TheiaGLSPClient that uses the MessageService to propagate connection errors. (#39)
- Use unique application id in widgetId.

Requires: eclipse-glsp/glsp-client/pull/79

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
- eclipse-glsp/glsp/issues/105
- eclipse-glsp/glsp/issues/39

* Fix minors and remove dep to @theia/languages

Co-authored-by: Philip Langer <planger@eclipsesource.com>
@tortmayr tortmayr self-assigned this Aug 25, 2020
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this issue Aug 25, 2020
* #105 #104 #96 #94 #39 Refactor client-server communication

-Update dependencies to conform to sprotty 0.9.0 and Theia 1.3.0
- Adapt code to confrom to client/server changes
- Change argument for passing the server port to "WF_GLSP"

Requires: 
- eclipse-glsp/glsp-server/pull/73
- eclipse-glsp/glsp-theia-integration/pull/44

Part of:
- eclipse-glsp/glsp/issues/104
- eclipse-glsp/glsp/issues/94
- eclipse-glsp/glsp/issues/96
- eclipse-glsp/glsp/issues/105

* Update launch config to changed env args

* Adapt copyright headers

* Update versions

Co-authored-by: Philip Langer <planger@eclipsesource.com>
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 27, 2020
Also: 
- Use new clientProxy provider instead of deriving the proxy from the client id.
- Fix/Surpress a couple of warnings
- Sort members of MultiBindingDefaults

Follow up for eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Aug 27, 2020
tortmayr added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Aug 27, 2020
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this issue Aug 27, 2020
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Aug 27, 2020
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Aug 27, 2020
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 27, 2020
Also: 
- Use new clientProxy provider instead of deriving the proxy from the client id.
- Fix/Surpress a couple of warnings
- Sort members of MultiBindingDefaults

Follow up for eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 27, 2020
Also: 
- Use new clientProxy provider instead of deriving the proxy from the client id.
- Fix/Surpress a couple of warnings
- Sort members of MultiBindingDefaults

Follow up for eclipse-glsp/glsp/issues/96
tortmayr added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Aug 27, 2020
* #96 Introduce InitializeClientSessionAction

Follow-up for eclipse-glsp/glsp/issues/96

* Update client version
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this issue Aug 27, 2020
* #96 Introduce InitializeClientSessionAction

Follow-up for eclipse-glsp/glsp/issues/96

* Update yarn lock
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 30, 2020
tortmayr added a commit to eclipse-glsp/glsp-server that referenced this issue Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants