added distribution task to client buildscript

This commit is contained in:
2021-11-17 12:31:35 +01:00
parent 8d7ab3e6e9
commit 7a0f30f8b7
15 changed files with 36 additions and 28 deletions

View File

@@ -54,14 +54,13 @@ public abstract class Context<S extends State<S,C>, C extends Context<S,C>> {
* @see State#onEnter(Context)
* @see #handleError(Throwable)
*/
@SuppressWarnings("unchecked")
public void transition(@NotNull S state) {
lock.lock();
try {
//noinspection unchecked
this.state.onExit((C) this);
onTransition(this.state, state);
this.state = state;
//noinspection unchecked
state.onEnter((C) this).ifPresent(this::transition);
} catch (Throwable t) {
handleError(t);

View File

@@ -15,12 +15,12 @@ public abstract class TimeoutContext<S extends TimeoutState<S,C>, C extends Time
super(initialState);
}
@SuppressWarnings("unchecked")
public void timeout(@NotNull S currentState, long delay) {
scheduler.schedule(() -> {
if (Objects.equals(getState(), currentState)) {
execute(() -> {
if (Objects.equals(getState(), currentState)) {
//noinspection unchecked
return currentState.onTimeout((C) this);
} else {
return Optional.empty();