congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WorkerThread.builder
Code IndexAdd Tabnine to your IDE (free)

How to use
builder
method
in
com.obsidiandynamics.worker.WorkerThread

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

origin: com.obsidiandynamics.blackstrom/blackstrom-core

public SingleNodeQueueLedger(Config config) {
 maxYields = config.maxYields;
 thread = WorkerThread.builder()
   .withOptions(new WorkerOptions()
          .daemon()
          .withName(SingleNodeQueueLedger.class, Integer.toHexString(System.identityHashCode(this))))
   .onCycle(this::cycle)
   .buildAndStart();
}

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.blackstrom/blackstrom-core

@Override
public void attach(MessageHandler handler) {
 if (handler.getGroupId() != null && ! groups.add(handler.getGroupId())) return;
 
 final WorkerThread thread = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(MultiNodeQueueLedger.class, handler.getGroupId()))
   .onCycle(new NodeWorker(handler, handler.getGroupId(), queue.consumer()))
   .buildAndStart();
 threads.add(thread);
}

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.blackstrom/blackstrom-core

public MonitorEngine(MonitorAction action, String groupId, MonitorEngineConfig config) {
 this.groupId = groupId;
 trackingEnabled = config.isTrackingEnabled();
 gcIntervalMillis = config.getGCInterval();
 outcomeLifetimeMillis = config.getOutcomeLifetime();
 timeoutIntervalMillis = config.getTimeoutInterval();
 metadataEnabled = config.isMetadataEnabled();
 this.action = action;
 
 if (trackingEnabled) {
  gcThread = WorkerThread.builder()
    .withOptions(new WorkerOptions()
           .daemon()
           .withName(MonitorEngine.class, groupId, "gc", Integer.toHexString(System.identityHashCode(this))))
    .onCycle(this::gcCycle)
    .buildAndStart();
 } else {
  gcThread = null;
 }
 
 timeoutThread = WorkerThread.builder()
   .withOptions(new WorkerOptions()
          .daemon()
          .withName(MonitorEngine.class, groupId, "timeout", Integer.toHexString(System.identityHashCode(this))))
   .onCycle(this::timeoutCycle)
   .buildAndStart();
}

origin: com.obsidiandynamics.jackdaw/jackdaw-core

public ConsumerPipe(ConsumerPipeConfig config, RecordHandler<K, V> handler, String threadName) {
 this.handler = handler;
 if (config.isAsync()) {
  mustExist(threadName, "Thread name cannot be null");
  queue = new LinkedBlockingQueue<>(config.getBacklogBatches());
  thread = WorkerThread.builder()
    .withOptions(new WorkerOptions().daemon().withName(threadName))
    .onCycle(this::cycle)
    .buildAndStart();
 } else {
  queue = null;
  thread = null;
 }
}

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.meteor/meteor-core

DefaultReceiver(Subscriber subscriber, RecordHandler recordHandler, int pollTimeoutMillis) {
 this.subscriber = subscriber;
 this.recordHandler = recordHandler;
 this.pollTimeoutMillis = pollTimeoutMillis;
 pollerThread = WorkerThread.builder()
   .withOptions(new WorkerOptions()
          .daemon()
          .withName(Receiver.class, subscriber.getConfig().getStreamConfig().getName(), "poller"))
   .onCycle(this::pollerCycle)
   .buildAndStart();
}

origin: com.obsidiandynamics.jackdaw/jackdaw-core

public ProducerPipe(ProducerPipeConfig config, Producer<K, V> producer, String threadName, ExceptionHandler exceptionHandler) {
 this.producer = producer;
 this.exceptionHandler = exceptionHandler;
 if (config.isAsync()) {
  queue = new NodeQueue<>();
  queueConsumer = queue.consumer();
  thread = WorkerThread.builder()
    .withOptions(new WorkerOptions().daemon().withName(threadName))
    .onCycle(this::cycle)
    .buildAndStart();
 } else {
  queue = null;
  queueConsumer = null;
  thread = null;
 }
}

origin: com.obsidiandynamics.hazelq/hazelq-elect

public Election(ElectionConfig config, IMap<String, byte[]> leases) {
 this.config = config;
 final Retry retry = new Retry()
   .withExceptionClass(HazelcastException.class)
   .withAttempts(Integer.MAX_VALUE)
   .withBackoff(100)
   .withFaultHandler(config.getZlg()::w)
   .withErrorHandler(config.getZlg()::e);
 this.leases = new RetryableMap<>(retry, leases);
 registry = new Registry();
 
 scavengerThread = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(Election.class, "scavenger"))
   .onCycle(this::scavegerCycle)
   .build();
}

origin: com.obsidiandynamics.meteor/meteor-elect

public Election(ElectionConfig config, IMap<String, byte[]> leases) {
 this.config = config;
 final Retry retry = new Retry()
   .withExceptionMatcher(isA(HazelcastException.class))
   .withAttempts(Integer.MAX_VALUE)
   .withBackoff(100)
   .withFaultHandler(config.getZlg()::w)
   .withErrorHandler(config.getZlg()::e);
 this.leases = new RetryableMap<>(retry, leases);
 registry = new Registry();
 
 scavengerThread = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(Election.class, "scavenger"))
   .onCycle(this::scavegerCycle)
   .build();
}

origin: com.obsidiandynamics.meteor/meteor-core

DefaultPublisher(HazelcastInstance instance, PublisherConfig config) {
 this.instance = instance;
 this.config = config;
 final StreamConfig streamConfig = config.getStreamConfig();
 final Retry retry = new Retry()
   .withExceptionMatcher(isA(HazelcastException.class))
   .withAttempts(Integer.MAX_VALUE)
   .withBackoff(100)
   .withFaultHandler(config.getZlg()::w)
   .withErrorHandler(config.getZlg()::e);
 buffer = new RetryableRingbuffer<>(retry, StreamHelper.getRingbuffer(instance, streamConfig));
 
 publishThread = WorkerThread.builder()
   .withOptions(new WorkerOptions().daemon().withName(Publisher.class, streamConfig.getName(), "publisher"))
   .onCycle(this::publisherCycle)
   .buildAndStart();
}

com.obsidiandynamics.workerWorkerThreadbuilder

Popular methods of WorkerThread

  • terminate
    Terminates the worker thread.
  • join
  • start
    Starts the worker thread.
  • <init>
  • cycle
  • getState
    Obtains the current state of the worker thread.
  • handleUncaughtException
  • whileNotInterrupted

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best plugins for Eclipse
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