Initial implementation for source collections. #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main points:
Set
,Cache
,Dictionary
, andList
, matching the previously-defined interfaces.ChangeTrackingXXX
classes for each collection type. These classes mimic theChangeAwareXXX
classes from DD today, and form the core of eachSubjectXXX
class, as well as a great basis for implementing operators, going forward.SubjectXXX
classes for each collection type. These classes mimic theSourceXXX
classes from DD today, and are the main public API for building change streams.SubjectXXX
can be extended or decorated in the future to add different levels of concurrency and thread-safety. This should allow consumers who don't need thread-safety to get more performance out of the library, and those who do need it to opt into it.There were a few things I cleaned up across the collection interfaces, including the following:
IObservable<>
of changes, rather than change sets.AddOrReplaceRange()
instead ofAddRange()
. This eliminates the possibility for corrupt collection states to occur, in the event of key mismatches by the consumer, and mimics howSourceCache<>
behaves in DD today.IExtendedXXX<>
interfaces, to allow forChangeTrackingXXX
collections to be defined.