Class PushConnection
java.lang.Object
com.netflix.zuul.netty.server.push.PushConnection
Author: Susheel Aroskar
Date:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.netflix.config.CachedDynamicIntProperty
static final com.netflix.config.CachedDynamicIntProperty
-
Constructor Summary
ConstructorDescriptionPushConnection
(PushProtocol pushProtocol, io.netty.channel.ChannelHandlerContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Implementation of TokenBucket algorithm to do rate limiting: http://stackoverflow.com/a/668327io.netty.channel.ChannelFuture
sendPing()
io.netty.channel.ChannelFuture
sendPushMessage
(io.netty.buffer.ByteBuf mesg) io.netty.channel.ChannelFuture
sendPushMessage
(String mesg) void
setSecureToken
(String secureToken)
-
Field Details
-
TOKEN_BUCKET_RATE
public static final com.netflix.config.CachedDynamicIntProperty TOKEN_BUCKET_RATE -
TOKEN_BUCKET_WINDOW
public static final com.netflix.config.CachedDynamicIntProperty TOKEN_BUCKET_WINDOW
-
-
Constructor Details
-
PushConnection
-
-
Method Details
-
getSecureToken
-
setSecureToken
-
isRateLimited
public boolean isRateLimited()Implementation of TokenBucket algorithm to do rate limiting: http://stackoverflow.com/a/668327- Returns:
- true if should be rate limited, false if it is OK to send the message
-
sendPushMessage
public io.netty.channel.ChannelFuture sendPushMessage(io.netty.buffer.ByteBuf mesg) -
sendPushMessage
-
sendPing
public io.netty.channel.ChannelFuture sendPing()
-