Coverage for src/dataknobs_fsm/core/modes.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-20 16:46 -0600

1"""Processing and transaction modes for FSM execution.""" 

2 

3from enum import Enum 

4 

5 

6class ProcessingMode(Enum): 

7 """Processing mode for FSM execution - defines how many records to process.""" 

8 

9 SINGLE = "single" 

10 """Process a single record at a time.""" 

11 

12 BATCH = "batch" 

13 """Process multiple records in a batch.""" 

14 

15 STREAM = "stream" 

16 """Process continuous stream of data.""" 

17 

18 

19class TransactionMode(Enum): 

20 """Transaction handling mode for FSM execution.""" 

21 

22 NONE = "none" 

23 """No transaction support.""" 

24 

25 PER_RECORD = "per_record" 

26 """One transaction per record.""" 

27 

28 PER_BATCH = "per_batch" 

29 """One transaction per batch.""" 

30 

31 PER_SESSION = "per_session" 

32 """One transaction for entire session.""" 

33 

34 DISTRIBUTED = "distributed" 

35 """Distributed transaction support."""