class StreamTask extends AbstractInvokable implements AsyncExceptionHandler {

	@Override
	public Future<Boolean> triggerCheckpointAsync(
			CheckpointMetaData checkpointMetaData,
			CheckpointOptions checkpointOptions,
			boolean advanceToEndOfEventTime) {

		CompletableFuture<Boolean> result = new CompletableFuture<>();
		mainMailboxExecutor.execute(
				() -> {
					latestAsyncCheckpointStartDelayNanos = 1_000_000 * Math.max(
						0,
						System.currentTimeMillis() - checkpointMetaData.getTimestamp());
					try {
						result.complete(triggerCheckpoint(checkpointMetaData, checkpointOptions, advanceToEndOfEventTime));
					}
					catch (Exception ex) {
						// Report the failure both via the Future result but also to the mailbox
						result.completeExceptionally(ex);
						throw ex;
					}
				},
				"checkpoint %s with %s",
			checkpointMetaData,
			checkpointOptions);
		return result;
	}

	protected  StreamTask(Environment env);
	protected  StreamTask(Environment env, @Nullable TimerService timerService);
	protected  StreamTask(
			Environment environment,
			@Nullable TimerService timerService,
			Thread.UncaughtExceptionHandler uncaughtExceptionHandler);
	protected  StreamTask(
			Environment environment,
			@Nullable TimerService timerService,
			Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
			StreamTaskActionExecutor actionExecutor);
	protected  StreamTask(
			Environment environment,
			@Nullable TimerService timerService,
			Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
			StreamTaskActionExecutor actionExecutor,
			TaskMailbox mailbox);

}