public void reload() {
    // If there are concurrent calls to reload (such that some calls come in when another call is
    // queued), then
    // don't bother doing the subsequent calls. Instead just rely on the currently queued call.
    //
    // Motivation is that calls to nginx.reload were backing up: we ended up executing lots of them
    // in parallel
    // when there were several changes to the nginx conifg that requiring a reload. The problem can
    // be particularly
    // bad because the ssh commands take a second or two - if 10 changes were made to the config in
    // that time, we'd
    // end up executing reload 10 times in parallel.

    reloadExecutor.run();
  }
Example #2
0
 /**
  * Provides the execution control bound to the current thread.
  *
  * <p>This method will fail when called outside of a Ratpack compute thread as it relies on {@link
  * ExecController#require()}.
  *
  * @return the execution control bound to the current thread
  */
 static ExecControl current() {
   return ExecController.require().getControl();
 }