[ROOT] / doc / toc / ARCCore / Class / PConcurrent
A (somewhat) thread-safe alternative to PRich which also supports ExposingApplicationState (through Logger).
With 'somewhat' thread-safe we mean that thread-safety is only guaranteed for writing / reading key and value pairs directly stored within this class, not for writing / reading to objects further down in the hierarchical storage.
Use this base class when you want to ExposingApplicationState throughout the PropertyStream.
(in other words, use this class as a base class for all parts of your application that do some kind of processing.)
By setting the Logger, every call to TrySetP will be logged.
In addition the metods Log and HandleException get more meaningful, as they will actually distribute the information somewhere.
The practical consequence of this is that you do not have to write log-code like this:
var c = new Connection()
c.Id ="My connection"
log("Created new connection with id " + c.Id)
See also ExposingApplicationState.
Note that more memory-hungry due to use of ConcurrentDictionary
Note that this class is normally meaningless to use as base-class for data-objects like 'Customer', 'Order' or similar, because they are by their nature meant to be distributed over the PropertyStream anyway, so changes to them will 'automatically' be logged (that is, sent to the PropertyStream).
Some inheriting classes in ARCCore are StreamProcessor and ActualConnection.
ToString | TODO: Decide on what we actually want with ToString for this class. |
Generated 2024-11-11 15:13:16.908 UTC