All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.ext.unit.impl.ExecutionContext Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR3
Show newest version
package io.vertx.ext.unit.impl;

import io.vertx.core.Context;

/**
 * The test suite global context.
 *
 * @author Julien Viet
 */
public class ExecutionContext {

  private final Context context;

  public ExecutionContext(Context context) {
    this.context = context;
  }

  public  void run(Task task, T value) {
    if (context != null) {
      context.runOnContext(v -> task.execute(value, this));
    } else {
      task.execute(value, this);
    }
  }

  public void run(Task task) {
    run(task, null);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy