using System;
using System.Threading.Tasks;
using Tapeti.Flow.Default;
// ReSharper disable UnusedMember.Global
namespace Tapeti.Flow
{
///
/// Provides a way to store and load flow state.
///
public interface IFlowStore
{
///
/// Must be called during application startup before subscribing or starting a flow.
/// If using an IFlowRepository that requires an update (such as creating tables) make
/// sure it is called before calling Load.
///
Task Load();
///
/// Looks up the FlowID corresponding to a ContinuationID. For internal use.
///
///
Task FindFlowID(Guid continuationID);
///
/// Acquires a lock on the flow with the specified FlowID.
///
///
Task LockFlowState(Guid flowID);
}
///
///
/// Represents a lock on the flow state, to provide thread safety.
///
public interface IFlowStateLock : IDisposable
{
///
/// The unique ID of the flow state.
///
Guid FlowID { get; }
///
/// Acquires a copy of the flow state.
///
Task GetFlowState();
///
/// Stores the new flow state.
///
///
Task StoreFlowState(FlowState flowState);
///
/// Disposes of the flow state corresponding to this Flow ID.
///
Task DeleteFlowState();
}
}