Class RequestManager
- java.lang.Object
-
- org.eclipse.xtext.ide.server.concurrent.RequestManager
-
public class RequestManager extends java.lang.Object- Since:
- 2.11
-
-
Constructor Summary
Constructors Constructor Description RequestManager(java.util.concurrent.ExecutorService parallel, org.eclipse.xtext.service.OperationCanceledManager operationCanceledManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRequest(AbstractRequest<?> request)protected java.util.concurrent.CompletableFuture<java.lang.Void>cancel()Cancel all requests in the queue.protected org.eclipse.xtext.service.OperationCanceledManagergetOperationCanceledManager()protected java.util.concurrent.ExecutorServicegetParallelExecutorService()protected booleanisCancelException(java.lang.Throwable t)Check if the given throwable is an indicator for a cancellation.<V> java.util.concurrent.CompletableFuture<V>runRead(org.eclipse.xtext.xbase.lib.Functions.Function1<? super org.eclipse.xtext.util.CancelIndicator,? extends V> cancellable)Run the given cancellable logic as a read request.<U,V>
java.util.concurrent.CompletableFuture<V>runWrite(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends U> nonCancellable, org.eclipse.xtext.xbase.lib.Functions.Function2<? super org.eclipse.xtext.util.CancelIndicator,? super U,? extends V> cancellable)Perform the given write and run the cancellable logic afterwards.voidshutdown()An orderly shutdown of this request manager.protected <V> java.util.concurrent.CompletableFuture<V>submit(AbstractRequest<V> request)Submit the given request.protected voidsubmitRequest(AbstractRequest<?> request)
-
-
-
Method Detail
-
shutdown
public void shutdown()
An orderly shutdown of this request manager.
-
getOperationCanceledManager
protected final org.eclipse.xtext.service.OperationCanceledManager getOperationCanceledManager()
-
getParallelExecutorService
protected final java.util.concurrent.ExecutorService getParallelExecutorService()
-
runRead
public <V> java.util.concurrent.CompletableFuture<V> runRead(org.eclipse.xtext.xbase.lib.Functions.Function1<? super org.eclipse.xtext.util.CancelIndicator,? extends V> cancellable)
Run the given cancellable logic as a read request.
-
runWrite
public <U,V> java.util.concurrent.CompletableFuture<V> runWrite(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends U> nonCancellable, org.eclipse.xtext.xbase.lib.Functions.Function2<? super org.eclipse.xtext.util.CancelIndicator,? super U,? extends V> cancellable)Perform the given write and run the cancellable logic afterwards.
-
submit
protected <V> java.util.concurrent.CompletableFuture<V> submit(AbstractRequest<V> request)
Submit the given request.
-
submitRequest
protected void submitRequest(AbstractRequest<?> request)
-
addRequest
protected void addRequest(AbstractRequest<?> request)
-
cancel
protected java.util.concurrent.CompletableFuture<java.lang.Void> cancel()
Cancel all requests in the queue.
-
isCancelException
protected boolean isCancelException(java.lang.Throwable t)
Check if the given throwable is an indicator for a cancellation.
-
-