executors-core

Parent pom for all Fizzed maven projects

Лицензия

Лицензия

Группа

Группа

com.fizzed
Идентификатор

Идентификатор

executors-core
Последняя версия

Последняя версия

0.0.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

executors-core
Parent pom for all Fizzed maven projects
Организация-разработчик

Организация-разработчик

Fizzed, Inc

Скачать executors-core

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.fizzed/executors-core/ -->
<dependency>
    <groupId>com.fizzed</groupId>
    <artifactId>executors-core</artifactId>
    <version>0.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.fizzed/executors-core/
implementation 'com.fizzed:executors-core:0.0.5'
// https://jarcasting.com/artifacts/com.fizzed/executors-core/
implementation ("com.fizzed:executors-core:0.0.5")
'com.fizzed:executors-core:jar:0.0.5'
<dependency org="com.fizzed" name="executors-core" rev="0.0.5">
  <artifact name="executors-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.fizzed', module='executors-core', version='0.0.5')
)
libraryDependencies += "com.fizzed" % "executors-core" % "0.0.5"
[com.fizzed/executors-core "0.0.5"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.30
com.fizzed : crux-util jar 1.0.37

test (4)

Идентификатор библиотеки Тип Версия
org.hamcrest : java-hamcrest jar 2.0.0.0
junit : junit jar 4.12
org.mockito : mockito-core jar 2.12.0
ch.qos.logback : logback-classic jar 1.1.7

Модули Проекта

Данный проект не имеет модулей.

Executors by Fizzed helps you build, manage, and operate long-lived workers (threads) on the JVM.

Java's standard ExecutorService and its various implementations (correctly) hide where and how your Runnable is executing. They are designed to abstract the run() method.

However, when building long-lived tasks, where some parts of your code are critical to not be interrupted (e.g. during a graceful shutdown). That's where the lack of context within your run() of how you're executing becomes a problem. This usually consists of waiting for work and being able to prevent shutdown until that work is completed.

This framework is a simple layer built on top of the ExecutorService to give your Workers the context and building blocks for rock-solid long-lived tasks.

Pattern 1: poll and accept next job (e.g. Blocking Queue)

while (!stopped) {
    job = pollAndAcceptNextJob()   // <-- critical start

if (job) {
        // handle job
}			       // <-- critical end

    sleep(2 seconds)               // <-- interrupt ok
}

Pattern 2: poll then accept next job (e.g. JMS w/ manual ack)

while (!stopped) {
    job = pollNextJob()            // <-- interrupt ok

    if (job) {
    // accept job (ack it)     // <-- critical start
        // handle job
    }                              // <-- critical end

    sleep(2 seconds)               // <-- interrupt ok
}
com.fizzed

Fizzed, Inc.

Helping companies launch and grow their mobile, web, and data products

Версии библиотеки

Версия
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1