Class: WebSocket::IdleHandler
- Inherits:
-
IdleStateUserEventHandler
- Object
- ChannelDuplexHandler
- IdleStateUserEventHandler
- WebSocket::IdleHandler
- Defined in:
- lib/websocket/idle_handler.rb
Overview
The IdleHandler class handles idle channels detected by the server pipeline.
Instance Method Summary collapse
- #handle_idle_channel(ctx, _evt) ⇒ Object
-
#initialize ⇒ IdleHandler
constructor
A new instance of IdleHandler.
Methods inherited from IdleStateUserEventHandler
Constructor Details
#initialize ⇒ IdleHandler
Returns a new instance of IdleHandler.
25 26 27 28 |
# File 'lib/websocket/idle_handler.rb', line 25 def initialize # Include additional subclass initialization here. super() end |
Instance Method Details
#handle_idle_channel(ctx, _evt) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/websocket/idle_handler.rb', line 30 def handle_idle_channel(ctx, _evt) klass = self.class.name log.debug "#{klass} < IdleStateUserEventHandler ##{__method__}" = TextWebSocketFrame.new("\nDisconnecting idle session\n") # TODO: Test ctx.writeAndFlush().sync ctx.close # ctx.channel.writeAndFlush(message).sync # ctx.channel.disconnect().awaitUninterruptibly() # ctx.channel.close().awaitUninterruptibly() end |