com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback
, com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback
public final class NeovimHandlerProxy
extends java.lang.Object
implements com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback, com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback
RPCListener.RequestCallback
and RPCListener.NotificationCallback
and as a listener
It passes all notifications/requests to contained listeners through a ExecutorService
By default ImmediateExecutorService
is used
Default instance with ImmediateExecutorService
is used by default in NeovimHandlerManager
This allows handlers to not block used streamer when notifications/requests arrive and when many handlers are used
Example:
NeovimHandlerProxy neovimHandlerProxy = new NeovimHandlerProxy(customExecutorService);
NeovimHandlerManager neovimHandlerManager = new NeovimHandlerManager(neovimHandlerProxy);
neovimHandlerManager.registerNeovimHandler(uiEventHandler);
neovimHandlerManager.attachToStream(neovimStream); // All notifications/requests are passed down using customExecutorService now
Constructor | Description |
---|---|
NeovimHandlerProxy() |
|
NeovimHandlerProxy(java.util.concurrent.ExecutorService executorService) |
Modifier and Type | Method | Description |
---|---|---|
void |
addNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback) |
|
void |
addRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback) |
|
void |
notificationReceived(com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage notificationMessage) |
|
void |
removeNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback) |
|
void |
removeRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback) |
|
void |
requestReceived(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage) |
public NeovimHandlerProxy()
public NeovimHandlerProxy(java.util.concurrent.ExecutorService executorService)
public void addNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)
public void addRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)
public void removeNotificationCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback notificationCallback)
public void removeRequestCallback(com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback requestCallback)
public void notificationReceived(com.ensarsarajcic.neovim.java.corerpc.message.NotificationMessage notificationMessage)
notificationReceived
in interface com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.NotificationCallback
public void requestReceived(com.ensarsarajcic.neovim.java.corerpc.message.RequestMessage requestMessage)
requestReceived
in interface com.ensarsarajcic.neovim.java.corerpc.client.RPCListener.RequestCallback
Copyright © 2018. All rights reserved.