Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCustomRejectedExecutionHandler ¶
func GetCustomRejectedExecutionHandler() filter.RejectedExecutionHandler
func GetDefaultValueRejectedExecutionHandlerSingleton ¶
func GetDefaultValueRejectedExecutionHandlerSingleton() filter.RejectedExecutionHandler
*
- the better way is designing the RejectedExecutionHandler as singleton.
Types ¶
type DefaultValueRejectedExecutionHandler ¶
type DefaultValueRejectedExecutionHandler struct {
// contains filtered or unexported fields
}
*
- The RejectedExecutionHandler is used by some components,
- e.g, ExecuteLimitFilter, GracefulShutdownFilter, TpsLimitFilter.
- When the requests are rejected, the RejectedExecutionHandler allows you to do something.
- You can alert the developer, or redirect those requests to another providers. It depends on what you need. *
- Let's assume that you need a RejectedExecutionHandler which will return some default result if the request was rejected.
func (*DefaultValueRejectedExecutionHandler) RejectedExecution ¶
func (mh *DefaultValueRejectedExecutionHandler) RejectedExecution(url *common.URL, invocation protocol.Invocation) protocol.Result
type RandomTpsLimitStrategy ¶
type RandomTpsLimitStrategy struct {
// contains filtered or unexported fields
}
*
- The RandomTpsLimitStrategy should not be singleton because different TpsLimiter will create many instances.
- we won't want them affect each other.
func (RandomTpsLimitStrategy) IsAllowable ¶
func (r RandomTpsLimitStrategy) IsAllowable() bool
*
- It implements the TpsLimitStrategy interface.
- IsAllowable will return true if this invocation is not over limitation.
type RandomTpsLimitStrategyCreator ¶
type RandomTpsLimitStrategyCreator struct{}
func (*RandomTpsLimitStrategyCreator) Create ¶
func (creator *RandomTpsLimitStrategyCreator) Create(rate int, interval int) filter.TpsLimitStrategy
*
- It implements the TpsLimitStrategyCreator interface.
- TpsLimitStrategyCreator is the creator abstraction for TpsLimitStrategy.
- Create will create an instance of TpsLimitStrategy.
type User ¶
func (*User) JavaClassName ¶
type UserProvider ¶
type UserProvider struct { }
Click to show internal directories.
Click to hide internal directories.