Package org.infinispan.server.resp
Class SubscriberHandler
java.lang.Object
org.infinispan.server.resp.RespRequestHandler
org.infinispan.server.resp.CacheRespRequestHandler
org.infinispan.server.resp.SubscriberHandler
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.infinispan.server.resp.CacheRespRequestHandler
cache
Fields inherited from class org.infinispan.server.resp.RespRequestHandler
BYTE_BUF_POOL_ATTRIBUTE_KEY, myStage, respServer, writer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletionStage
<RespRequestHandler> actualHandleRequest
(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments) Handles the RESP request returning a stage that when complete notifies the command has completed as well as providing the request handler for subsequent commands.void
handleChannelDisconnect
(io.netty.channel.ChannelHandlerContext ctx) handleStageListenerError
(CompletionStage<Void> stage, byte[] keyChannel, boolean subscribeOrUnsubscribe) static RespCacheListener
newKeyListener
(io.netty.channel.Channel channel, byte[] key) static RespCacheListener
newPatternListener
(io.netty.channel.Channel channel, byte[] pattern) void
sendSubscriptions
(io.netty.channel.ChannelHandlerContext ctx, CompletionStage<Void> stageToWaitFor, Collection<byte[]> keyChannels, boolean isSubscribe) unsubscribeAll
(io.netty.channel.ChannelHandlerContext ctx) Methods inherited from class org.infinispan.server.resp.CacheRespRequestHandler
cache, setCache, typedCache
Methods inherited from class org.infinispan.server.resp.RespRequestHandler
commandNotFound, handleRequest, initializeIfNecessary, myStage, respServer, stageToReturn, stageToReturn, stageToReturn, writer
-
Constructor Details
-
SubscriberHandler
-
-
Method Details
-
newKeyListener
-
newPatternListener
public static RespCacheListener newPatternListener(io.netty.channel.Channel channel, byte[] pattern) -
specificChannelSubscribers
-
resp3Handler
-
handleChannelDisconnect
public void handleChannelDisconnect(io.netty.channel.ChannelHandlerContext ctx) - Overrides:
handleChannelDisconnect
in classRespRequestHandler
-
actualHandleRequest
protected CompletionStage<RespRequestHandler> actualHandleRequest(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments) Description copied from class:RespRequestHandler
Handles the RESP request returning a stage that when complete notifies the command has completed as well as providing the request handler for subsequent commands.Implementations should never use the ByteBufAllocator in the context. Instead, they should use
RespRequestHandler.writer
to retrieve aResponseWriter
This ByteBuffer should only have bytes written to it adding up to the size requested. The ByteBuffer itself should never be written to the context or channel and flush should also never be invoked. Failure to do so may cause mis-ordering or responses as requests support pipelining and a ByteBuf may not be sent down stream until later in the pipeline.- Overrides:
actualHandleRequest
in classRespRequestHandler
- Parameters:
ctx
- Netty context pipeline for this requestcommand
- The command typearguments
- The remaining arguments to the command- Returns:
- stage that when complete returns the new handler to instate. This stage must be completed on the event loop
-
handleStageListenerError
public CompletionStage<Void> handleStageListenerError(CompletionStage<Void> stage, byte[] keyChannel, boolean subscribeOrUnsubscribe) -
removeAllListeners
public void removeAllListeners() -
unsubscribeAll
public CompletionStage<RespRequestHandler> unsubscribeAll(io.netty.channel.ChannelHandlerContext ctx) -
sendSubscriptions
public CompletionStage<RespRequestHandler> sendSubscriptions(io.netty.channel.ChannelHandlerContext ctx, CompletionStage<Void> stageToWaitFor, Collection<byte[]> keyChannels, boolean isSubscribe)
-