In some manner, the pending flag can be considered a 'lock' on initiating processing for a given field in the blackboard model.
In some manner, the pending flag can be considered a 'lock' on initiating processing for a given field in the blackboard model. The use case is this: an object is being built up through a sequence of asynchronous calls to external processes; setting a field to 'pending' indicates that that process has been kicked off and doesn't need to be kicked off again. If that process responds with an incomplete state (e.g. a server timeout), it is useful to be turn off the pending flag to allow for the processing to be initiated again (thereby 'unlocking' the field). The ability to turn off the pending 'lock' is necessary in a case such as this, where there is no value to set on the field and the blackboard is still building the model (i.e. a 'not set' state is entirely valid).
Flag a field as pending, supported in the blackboard model.
Flag a field as pending, supported in the blackboard model. This will do nothing if the field is already populated with a value other than None. None will be overwritten because it is implicit acknowledgement from the developer that the value can be in a "not set" state (i.e. None). Pending should overwrite this because it will potentially be setting it to a Some.
A Long representing the amount of time from now() that the pending flag should expire; use the 'unit' parameter to indicate the units of time that it represents. If the field has not been set within this time period, the pending flag will be ignored.
A TimeUnit that indicates what units the expireAfter parameter is in.
This class is used to make sure that you are passing the right type to "to". Before this, you could "set(_.foo).to(bar), and get a runtime failure if bar was not the right type.
A note to people who expand functionality here: dealing with new values happens both here (in RichOpmObject) and in OpmFactory.diffModels (for evolving an existing model with an overlaid model). Make sure you make updates to both.