| Package | Description |
|---|---|
| net.lecousin.framework.concurrent |
Multi-threading framework.
|
| net.lecousin.framework.concurrent.synch |
Classes implementing synchronization points such as asynchronous result, join point...
|
| net.lecousin.framework.concurrent.tasks |
Implementations of tasks.
|
| net.lecousin.framework.concurrent.util.production.simple |
Production model: a producer produces objects that are consumed by a consumer.
This allows asynchronous production and consumption. An example is a server task producing an output, and a consumer sending it over the network. |
| net.lecousin.framework.io.serialization |
Serialization and deserialization framework.
|
| net.lecousin.framework.io.util |
Utility classes for IO.
|
| net.lecousin.framework.progress |
Progression of asynchronous or background works.
|
| Modifier and Type | Method and Description |
|---|---|
CancelException |
Task.getCancelEvent() |
| Modifier and Type | Method and Description |
|---|---|
void |
Task.cancel(CancelException reason)
Cancel this task.
|
void |
Task.Output.cancel(CancelException reason) |
boolean |
Task.cancelIfExecutionNotStarted(CancelException reason)
Cancel this task only if not yet started.
|
| Modifier and Type | Method and Description |
|---|---|
abstract T |
Task.run()
Method to implement to execute the task.
|
static <TError extends Exception> |
Threading.waitUnblockedWithError(Collection<AsyncWork<?,TError>> tasks)
Wait for the given tasks to finish, if one has an error this error is immediately thrown without waiting for other tasks.
|
| Modifier and Type | Method and Description |
|---|---|
CancelException |
WaitingDataQueueSynchronizationPoint.getCancelEvent() |
CancelException |
SynchronizationPoint.getCancelEvent() |
CancelException |
LockPoint.getCancelEvent() |
CancelException |
ISynchronizationPoint.getCancelEvent()
Get the reason of the cancellation.
|
CancelException |
AsyncWork.getCancelEvent() |
| Modifier and Type | Method and Description |
|---|---|
void |
WaitingDataQueueSynchronizationPoint.cancel(CancelException reason) |
void |
SynchronizationPoint.cancel(CancelException reason) |
void |
LockPoint.cancel(CancelException reason) |
void |
ISynchronizationPoint.cancel(CancelException reason)
Cancel this synchronization point: unblock it immediately, and set the cancellation reason.
|
void |
AsyncWork.cancel(CancelException reason) |
void |
AsyncWork.AsyncWorkListener.cancelled(CancelException event)
Called when the AsyncWork is unblocked by a cancellation.
|
void |
AsyncWork.unblockCancel(CancelException event)
Cancel this AsyncWork.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AsyncWork.listenInline(Listener<T> onready,
Listener<TError> onerror,
Listener<CancelException> oncancel)
Call one of the given listener depending on result.
|
default void |
ISynchronizationPoint.listenInline(Runnable onReady,
Listener<TError> onError,
Listener<CancelException> onCancel)
Call listeners when unblocked.
|
default void |
ISynchronizationPoint.onCancel(Listener<CancelException> listener)
Call the given listener, only when this synchronization point is unblocked due to cancellation.
|
| Modifier and Type | Method and Description |
|---|---|
T |
AsyncWork.blockResult(long timeout)
Block until this AsyncWork is unblocked or the given timeout expired,
and return the result in case of success, or throw the error or cancellation.
|
default void |
ISynchronizationPoint.blockThrow(long timeout)
Pause the current thread to wait for this synchronization point to be unblocked.
|
| Constructor and Description |
|---|
AsyncWork(T result,
TError error,
CancelException cancel)
Create an unblocked point with the given result, error and cancellation.
|
SynchronizationPoint(CancelException cancel)
Create an unblocked point with a cancellation.
|
| Modifier and Type | Method and Description |
|---|---|
Void |
SavePropertiesFileTask.run() |
| Modifier and Type | Method and Description |
|---|---|
void |
ProductTransformation.cancel(CancelException event) |
void |
Producer.cancel(CancelException event)
Cancel any pending production and stop it.
|
void |
Consumer.cancel(CancelException event)
Cancel and stop consumption.
|
| Modifier and Type | Method and Description |
|---|---|
Void |
AbstractSerializer.SerializationTask.run() |
Void |
AbstractDeserializer.DeserializationTask.run() |
| Modifier and Type | Method and Description |
|---|---|
void |
IOReaderAsProducer.cancel(CancelException event) |
| Modifier and Type | Method and Description |
|---|---|
void |
WorkProgressImpl.cancel(CancelException reason) |
void |
WorkProgress.cancel(CancelException reason)
Cancel the underlying work.
|
void |
FakeWorkProgress.cancel(CancelException reason) |
Copyright © 2017. All rights reserved.