gpt4 book ai didi

com.jetdrone.vertx.yoke.Yoke.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:04:49 26 4
gpt4 key购买 nike

本文整理了Java中com.jetdrone.vertx.yoke.Yoke.<init>()方法的一些代码示例,展示了Yoke.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yoke.<init>()方法的具体详情如下:
包路径:com.jetdrone.vertx.yoke.Yoke
类名称:Yoke
方法名:<init>

Yoke.<init>介绍

[英]Creates a Yoke instance. This constructor should be called from a verticle and pass a valid Vertx instance. This instance will be shared with all registered middleware. The reason behind this is to allow middleware to use Vertx features such as file system and timers.

public class MyVerticle extends AbstractVerticle { 
public void start() { 
final Yoke yoke = new Yoke(this); 
... 
} 
}

[中]创建一个实例。应该从verticle调用此构造函数,并传递一个有效的Vertx实例。此实例将与所有注册的中间件共享。这背后的原因是允许中间件使用诸如文件系统和计时器之类的Vertx功能

public class MyVerticle extends AbstractVerticle { 
public void start() { 
final Yoke yoke = new Yoke(this); 
... 
} 
}

代码示例

代码示例来源:origin: pmlopes/yoke

@Override
 public void start() {

  new Yoke(this)
    .use(new Router()
      .get("/", new Handler<YokeRequest>() {
       @Override
       public void handle(YokeRequest request) {
        request.response().end("Hello World\n");
       }
      })
    ).listen(8080);
 }
}

代码示例来源:origin: pmlopes/yoke

@Override
public void start() {
 final Yoke yoke = new Yoke(this);

代码示例来源:origin: pmlopes/yoke

@Override
public void start() throws Exception {
 final Yoke yoke = new Yoke(this);

代码示例来源:origin: pmlopes/yoke

new Yoke(this)
  .use(new BodyParser())
  .use("/middleware", foo)

代码示例来源:origin: pmlopes/yoke

@Override
public void start() {
 final Yoke app = new Yoke(this);
 app.secretSecurity("keyboard cat");

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com