You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if it would make sense to have a CompletableFuture as the result type of the JSON-RPC Launcher#startListening?
The Future is create here: org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.startProcessing(MessageProducer, MessageConsumer, ExecutorService) org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.beginProcessing(ExecutorService)
Could it be changed to CompletableFuture.runAsync( reader/this, executorService )
Thank you for your suggestion, it sounds interesting.
Until someone with a deeper knowledge of the subject replies, here are my two cents:
Obviously, this would be a breaking API change. In particular, it could break any existing implementation of the Launcher interface.
There is a difference in behavior of the cancel method of a Future returned from ExecutorService.submit and a CompletableFuture returned from CompletableFuture.runAsyc. The latter ignores the mayInterruptIfRunning parameter, i.e. it will not try to stop the running task.
Hi Lsp4J,
I wonder if it would make sense to have a
CompletableFuture
as the result type of the JSON-RPC Launcher#startListening?The Future is create here:
org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.startProcessing(MessageProducer, MessageConsumer, ExecutorService)
org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.beginProcessing(ExecutorService)
Could it be changed to
CompletableFuture.runAsync( reader/this, executorService )
In the ChatExample from here: https://www.eclipse.org/community/eclipse_newsletter/2017/may/article2.php
The class SocketLauncher is mainly there to do the conversion Future -> CompletableFuture and creates a blocking thread to do so. This seems waste to me.
Frank
The text was updated successfully, but these errors were encountered: