Search in sources :

Example 1 with ConnectionDeactivatedEvent

use of io.lettuce.core.event.connection.ConnectionDeactivatedEvent in project lettuce-core by lettuce-io.

the class ConnectionEventTrigger method channelInactive.

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    connectionEvents.fireEventRedisDisconnected(connection);
    CommandHandler commandHandler = getCommandHandler(ctx);
    String epid = commandHandler.getEndpoint().getId();
    eventBus.publish(new ConnectionDeactivatedEvent(getRedisUri(ctx.channel()), epid, commandHandler.getChannelId(), local(ctx), remote(ctx)));
    super.channelInactive(ctx);
}
Also used : ConnectionDeactivatedEvent(io.lettuce.core.event.connection.ConnectionDeactivatedEvent) CommandHandler(io.lettuce.core.protocol.CommandHandler)

Aggregations

ConnectionDeactivatedEvent (io.lettuce.core.event.connection.ConnectionDeactivatedEvent)1 CommandHandler (io.lettuce.core.protocol.CommandHandler)1