Ejemplo n.º 1
0
  public static synchronized ScheduledExecutorService scheduler() {
    if (SCHEDULER == null) {
      int threads = Conf.option("threads", 100);
      SCHEDULER = Executors.newScheduledThreadPool(threads / 2, new RapidoidThreadFactory("jobs"));
    }

    return SCHEDULER;
  }
Ejemplo n.º 2
0
  public static synchronized Executor executor() {
    if (EXECUTOR == null) {
      int threads = Conf.option("threads", 100);
      EXECUTOR = Executors.newFixedThreadPool(threads);
    }

    return EXECUTOR;
  }
Ejemplo n.º 3
0
  @Test
  public void testSecret() {
    notNull(Crypto.secret());
    isTrue(Crypto.secret() == Crypto.secret());

    // default secret in dev mode is an empty string
    eq(Crypto.secret(), "");

    Conf.args("secret=mysecret");
    eq(Crypto.secret(), "mysecret");
  }