io.dataspray.runner.StateManagerFactory Maven / Gradle / Ivy
// SPDX-FileCopyrightText: 2019-2022 Matus Faro
// SPDX-License-Identifier: Apache-2.0
package io.dataspray.runner;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import java.time.Duration;
import java.util.Optional;
/**
* A factory for {@link StateManager}s that allows for easy access and efficiency.
*
* This class is thread-safe, and safe to use for across multiple incoming messages, but is not safe across tasks.
* {@link StateManager}s are reused and only flushed when necessary. Ensure to call {@link #closeAll()} when done.
*/
public interface StateManagerFactory {
StateManager getStateManager(String[] key, Optional ttl);
DynamoDbClient getDynamoClient();
void flushAll();
void closeAll();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy