Skip to content

Commit

Permalink
Experiment for aborting callbacks
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
gregw committed Jun 5, 2024
1 parent 860fbd0 commit f4955be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ default void succeeded()
* {@link #failed(Throwable)}</p>
*
* @param cause the reason for the operation failure
* @return {@code} if the call to cancel was prior to a call to either {@link #succeeded()}, {@link #failed(Throwable)}
* or another call to {@code cancel(Throwable)}.
* @return {@code true} if the call to abort was prior to a call to either {@link #succeeded()}, {@link #failed(Throwable)}
* or another call to {@code abort(Throwable)}.
* @see Completing
*/
default boolean abort(Throwable cause)
Expand Down Expand Up @@ -369,9 +369,9 @@ public void succeeded()
}

@Override
public boolean abort(Throwable cancelCause)
public boolean abort(Throwable abortCause)
{
ExceptionUtil.addSuppressedIfNotAssociated(cause, cancelCause);
ExceptionUtil.addSuppressedIfNotAssociated(cause, abortCause);
return callback.abort(cause);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

IDLE:
PROCESSING:
PROCESSING_SUCCESS_CALLED:
PROCESSING_FAILED_CALLED:
PROCESSING_CALLED:
PROCESSING_ABORT:
PROCESSING_ABORT_CALLED:
PROCESSING_CALLED_ABORT:
PENDING:
PENDING_ABORT_CALLED:
PENDING_ABORT:
FINISHED:

[*] --> IDLE
Expand All @@ -18,32 +17,29 @@ IDLE --> FINISHED: abort(x)
PROCESSING --> IDLE: a=IDLE
PROCESSING --> FINISHED: a=SUCCEEDED
PROCESSING --> PENDING: a=SCHEDULED
PROCESSING --> PROCESSING_SUCCESS_CALLED: succeeded()
PROCESSING --> PROCESSING_FAILED_CALLED: failed(x)
PROCESSING --> PROCESSING_CALLED: succeeded()
PROCESSING --> PROCESSING_CALLED: failed(x)
PROCESSING --> PROCESSING_ABORT: abort(x)

PENDING --> PROCESSING: succeeded()
PENDING --> FINISHED: failed(x)
PENDING --> PENDING_ABORT_CALLED: abort(x)
PENDING --> PENDING_ABORT: abort(x)

PROCESSING_SUCCESS_CALLED --> PROCESSING: a=SCHEDULED
PROCESSING_SUCCESS_CALLED --> PROCESSING_ABORT_CALLED: abort(x)

PROCESSING_FAILED_CALLED --> FINISHED: a=SCHEDULED
PROCESSING_FAILED_CALLED --> PROCESSING_ABORT_CALLED: abort(x)
PROCESSING_CALLED --> PROCESSING: a=SCHEDULED
PROCESSING_CALLED --> PROCESSING_CALLED_ABORT: abort(x)

PROCESSING_ABORT --> FINISHED: a=IDLE
PROCESSING_ABORT --> FINISHED: a=SUCCEEDED
PROCESSING_ABORT --> PENDING_ABORT_CALLED: a=SCHEDULED
PROCESSING_ABORT --> PROCESSING_ABORT_CALLED: succeeded()
PROCESSING_ABORT --> PROCESSING_ABORT_CALLED: failed(x)
PROCESSING_ABORT --> PENDING_ABORT: a=SCHEDULED
PROCESSING_ABORT --> PROCESSING_CALLED_ABORT: succeeded()
PROCESSING_ABORT --> PROCESSING_CALLED_ABORT: failed(x)
PROCESSING_ABORT --> PROCESSING_ABORT: abort(x)

PENDING_ABORT_CALLED --> FINISHED: succeeded()
PENDING_ABORT_CALLED --> FINISHED: failed(x)
PENDING_ABORT_CALLED --> PENDING_ABORT_CALLED: abort(x)
PENDING_ABORT --> FINISHED: succeeded()
PENDING_ABORT --> FINISHED: failed(x)
PENDING_ABORT --> PENDING_ABORT: abort(x)

PROCESSING_ABORT_CALLED -> FINISHED: a=*
PROCESSING_ABORT_CALLED -> ABORTING: abort(x)
PROCESSING_CALLED_ABORT -> FINISHED: a=*
PROCESSING_CALLED_ABORT -> PROCESSING_CALLED_ABORT: abort(x)

@enduml

0 comments on commit f4955be

Please sign in to comment.