Skip to content

Conversation

@peter-quix
Copy link
Contributor

Implemented the stream states in C# and Python.

  • C# support generic and non-generic variant, while python is only supporting generic variant for now.
  • State is saved OnCommitting.
  • State is revoked when stream is revoked.

Known issues:

  • Potential improvement could be done by adding staging support in IStateStorage. Stage with OnCommitting, Finalize with OnCommitted, to reduce chance of unsuccessful storage save to minimum offered by storage limitations.
  • When a consumed stream is closed, revocation doesn't include it in the list. this can cause saving state even when shouldn't
  • Possibly threading issues when modifying a state from multiple threads. Attempted to reproduce using unit tests in C# and python without luck. Left without locking implemented for now

Peter Nagy added 26 commits May 8, 2023 16:23
- Move tests from MS tests to xunit
- Introduce State, which is a key-val in memory state backed by another persisted state
- Minor fix for StateValue to properly compare
- FileStorage is no longer case sensitive
- Add Case sensitivity to IStateStorage
- Add Count to IStateStorage
- Implement TopicState
- Add Topic information to TelemetryKafkaConsumer
- Add tests
- Added State<T> 
- Refactored TopicState to use State<T>
- Added TopicState
- Added PrefixedLoggerFactory
- Moved StreamState next to StreamConsumer
- Removed unused properties all around
- Implement double-lock pattern where relevant
- Hook up StreamState, so it is actually usable
- Change to Logger from Console.WriteLine
- Handle unsupported types better, filter them out sooner
- Add App state manager to allow overriding the state storage
- Add missing management functions such as get/delete 
- Some WIP for python
Will deal with topic/app states using another method, but for now we don't need any prefixing
- some reference fixes to be relative
- AppStateManager exposed
- Add support for reference type values
- Add support for handling invalid type retrieval
- Handle interop keyerror
@peter-quix peter-quix marked this pull request as draft May 9, 2023 22:52
harisbotic
harisbotic previously approved these changes May 17, 2023
Copy link
Contributor

@harisbotic harisbotic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good expect from few renames or cleanups that I would do

@peter-quix peter-quix marked this pull request as ready for review May 22, 2023 15:16
@harisbotic harisbotic merged commit 4776fe0 into main May 25, 2023
@harisbotic harisbotic deleted the feature/state-helpers branch May 25, 2023 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants