25 lines
461 B
Java
25 lines
461 B
Java
package com.sf.vertx.handle;
|
|
|
|
import io.vertx.codegen.annotations.VertxGen;
|
|
import io.vertx.core.Handler;
|
|
import io.vertx.ext.web.RoutingContext;
|
|
|
|
/***
|
|
* 限流熔断, redis存储
|
|
* @author xy
|
|
*
|
|
*/
|
|
@VertxGen
|
|
public interface AppRateLimitHandler extends Handler<RoutingContext> {
|
|
|
|
static AppRateLimitHandler create(String instance) {
|
|
switch (instance) {
|
|
case "redis":
|
|
default:
|
|
// 本地缓存
|
|
return new AppRateLimitHandlerImpl();
|
|
}
|
|
|
|
}
|
|
}
|