Module neovim.notifications
Class NeovimStreamNotificationHandler
- java.lang.Object
-
- com.ensarsarajcic.neovim.java.notifications.NeovimStreamNotificationHandler
-
- All Implemented Interfaces:
NeovimNotificationHandler
public final class NeovimStreamNotificationHandler extends java.lang.Object implements NeovimNotificationHandler
Implementation ofNeovimNotificationHandler
based onReactiveRpcStreamer
Utilizes
NotificationCreatorCollector
for generating actual objects from raw data andReactiveRpcStreamer
for reading incoming notifications. Output should provide properly generated notifications of the right type which can be casted to access notification specific data.Example:
NeovimNotificationHandler notificationHandler = new NeovimNotificationHandler(streamer); notification.uiEvents().subscribe(uiEventSubscriber); notification.bufferEvents().subscribe(bufferEventSubscriber);
-
-
Constructor Summary
Constructors Constructor Description NeovimStreamNotificationHandler(com.ensarsarajcic.neovim.java.corerpc.reactive.ReactiveRpcStreamer reactiveRpcStreamer)
Creates a newNeovimStreamNotificationHandler
reading notifications fromReactiveRpcStreamer
passed in the constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.Flow.Publisher<BufferEvent>
bufferEvents()
Passes down a publisher ofBufferEvent
objects receivedBufferEvent
is a special type of notification that is received when attached to a buffer in Neovim It will never completejava.util.concurrent.Flow.Publisher<NeovimRedrawEvent>
uiEvents()
Passes down a publisher ofNeovimRedrawEvent
objects receivedNeovimRedrawEvent
is a special type of notification that is received when attached to Neovim It will never complete
-
-
-
Constructor Detail
-
NeovimStreamNotificationHandler
public NeovimStreamNotificationHandler(com.ensarsarajcic.neovim.java.corerpc.reactive.ReactiveRpcStreamer reactiveRpcStreamer)
Creates a newNeovimStreamNotificationHandler
reading notifications fromReactiveRpcStreamer
passed in the constructor. It may not be null.- Parameters:
reactiveRpcStreamer
- streamer to be used to read notifications- Throws:
java.lang.NullPointerException
- if reactiveRpcStreamer is null
-
-
Method Detail
-
uiEvents
public java.util.concurrent.Flow.Publisher<NeovimRedrawEvent> uiEvents()
Description copied from interface:NeovimNotificationHandler
Passes down a publisher ofNeovimRedrawEvent
objects receivedNeovimRedrawEvent
is a special type of notification that is received when attached to Neovim It will never complete- Specified by:
uiEvents
in interfaceNeovimNotificationHandler
- Returns:
Flow.Publisher
passing down ui events as they come
-
bufferEvents
public java.util.concurrent.Flow.Publisher<BufferEvent> bufferEvents()
Description copied from interface:NeovimNotificationHandler
Passes down a publisher ofBufferEvent
objects receivedBufferEvent
is a special type of notification that is received when attached to a buffer in Neovim It will never complete- Specified by:
bufferEvents
in interfaceNeovimNotificationHandler
- Returns:
Flow.Publisher
passing down buffer events as they come
-
-