Tabnine Logo
com.obsidiandynamics.worker
Code IndexAdd Tabnine to your IDE (free)

How to use com.obsidiandynamics.worker

Best Java code snippets using com.obsidiandynamics.worker (Showing top 20 results out of 315)

origin: com.obsidiandynamics.fulcrum/fulcrum-scheduler

public TaskScheduler(String threadName) {
 executor = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(threadName))
   .onCycle(this::cycle)
   .build();
}

origin: com.obsidiandynamics.jackdaw/jackdaw-core

public AsyncReceiver(Consumer<K, V> consumer, int pollTimeoutMillis, String threadName, 
           RecordHandler<K, V> recordHandler, ExceptionHandler exceptionHandler) {
 this.consumer = consumer;
 this.pollTimeoutMillis = pollTimeoutMillis;
 this.recordHandler = recordHandler;
 this.exceptionHandlerHandler = exceptionHandler;
 thread = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(threadName))
   .onCycle(this::cycle)
   .onShutdown(this::shutdown)
   .buildAndStart();
}

origin: com.obsidiandynamics.blackstrom/blackstrom-core

 @Override
 public void dispose() {
  thread.terminate().joinSilently();
 }
}
origin: com.obsidiandynamics.meteor/meteor-elect

@Override
public Joinable terminate() {
 scavengerThread.terminate();
 return this;
}
origin: com.obsidiandynamics.fulcrum/fulcrum-flow

 @Override
 public boolean join(long timeoutMillis) throws InterruptedException {
  return executor.join(timeoutMillis);
 }
}
origin: com.obsidiandynamics.fulcrum/fulcrum-worker

 public WorkerThread buildAndStart() {
  final WorkerThread thread = build();
  thread.start();
  return thread;
 }
}
origin: com.obsidiandynamics.blackstrom/blackstrom-core

 @Override
 public void dispose() {
  Terminator.of(threads).terminate().joinSilently();
 }
}
origin: com.obsidiandynamics.blackstrom/blackstrom-core

@Override
public Joinable terminate() {
 synchronized (terminateLock) {
  // as flows are created lazily, it's possible that some flows are created after termination of
  // this container; this flag ensures that new flows are stillborn
  terminated = true;
  Terminator.of(createdFlows).terminate();
 }
 return this;
}
origin: com.obsidiandynamics.meteor/meteor-elect

public Election start() {
 scavengerThread.start();
 return this;
}

origin: com.obsidiandynamics.fulcrum/fulcrum-worker

/**
 *  Waits until this concurrent entity terminates.<p>
 *  
 *  This variant suppresses an {@link InterruptedException} and will re-assert the interrupt 
 *  prior to returning.
 */
default void joinSilently() {
 joinSilently(0);
}

origin: com.obsidiandynamics.fulcrum/fulcrum-worker

/**
 *  Waits until this concurrent entity terminates.
 *  
 *  @throws InterruptedException If the thread is interrupted.
 */
default void join() throws InterruptedException {
 join(0);
}

origin: com.obsidiandynamics.fulcrum/fulcrum-worker

private void handleUncaughtException(Throwable exception) {
 if (exception != null && ! (exception instanceof InterruptedException)) {
  onUncaughtException.handle(this, exception);
 }
}

origin: com.obsidiandynamics.fulcrum/fulcrum-worker

 public static Terminator blank() {
  return new Terminator();
 }
}
origin: com.obsidiandynamics.fulcrum/fulcrum-flow

public Flow(FiringStrategy.Factory firingStrategyFactory, String threadName) {
 executor = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(threadName))
   .onCycle(firingStrategyFactory.create(this, tail))
   .buildAndStart();
}

origin: com.obsidiandynamics.meteor/meteor-core

@Override
public Joinable terminate() {
 publishThread.terminate();
 return this;
}
origin: com.obsidiandynamics.hazelq/hazelq-elect

 @Override
 public boolean join(long timeoutMillis) throws InterruptedException {
  return scavengerThread.join(timeoutMillis);
 }
}
origin: com.obsidiandynamics.fulcrum/fulcrum-flow

/**
 *  Terminates the flow, shutting down the worker thread and preventing further 
 *  task executions.
 *  
 *  @return A {@link Joinable} for the caller to wait on.
 */
@Override
public Joinable terminate() {
 executor.terminate();
 return this;
}

origin: com.obsidiandynamics.jackdaw/jackdaw-core

 @Override
 public boolean join(long timeoutMillis) throws InterruptedException {
  return thread.join(timeoutMillis);
 }
}
origin: com.obsidiandynamics.hazelq/hazelq-elect

@Override
public Joinable terminate() {
 scavengerThread.terminate();
 return this;
}
origin: com.obsidiandynamics.meteor/meteor-core

@Override
public boolean join(long timeoutMillis) throws InterruptedException {
 return pollerThread.join(timeoutMillis);
}

com.obsidiandynamics.worker

Most used classes

  • WorkerOptions
  • WorkerThread
  • WorkerThreadBuilder
  • Joiner
    An accumulator for composing operations over instances of type Joinable. Rather than joining on each
  • Terminator
    An accumulator for composing operations over instances of type Terminable. Rather than terminating e
  • FluentOperatingSet,
  • Terminable,
  • WorkerCycle,
  • WorkerExceptionHandler,
  • WorkerShutdown,
  • WorkerStartup
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now