The messages going out to the client are decoupled from the rate at which notifications are created.
I checked the OPC UA spec on this. The full spec can be downloaded on the homepage of the OPC Foundation.
Accounts can be registered with just a valid email address. Actually, there is quite a bit of flexibility in the allowed behaviour.
The following are relevant excerpts from part 4, §5.12.1.2 Sampling Interval.
In general, sections §5.12.1 MonitoredItem Model and §5.13.1 Subscription Model should provide all the answers.
The assigned sampling interval defines a “best effort” cyclic rate that the Server uses to sample
the item from its source. “Best effort” in this context means that the Server does its best to sample
at this rate. Sampling at rates faster than this rate is acceptable, but not necessary to meet the
needs of the Client. How the Server deals with the sampling rate and how often it actually polls its
data source internally is a Server implementation detail. However, the time between values
returned to the Client shall be greater or equal to the sampling interval.
The fastest supported sampling interval may be equal to 0, which
indicates that the data item is exception-based rather than being sampled at some period.
Note that, in many cases, the OPC UA Server provides access to a decoupled system and
therefore has no knowledge of the data update logic. In this case, even though the OPC UA
Server samples at the negotiated rate, the data might be updated by the underlying system at a
much slower rate.
Currently, the MonitoredItem can only test for value changes by invoking the read service and comparing the value with the last result.
We could add a hook or "exception mechanism" that updates the MonitoredItems at every write, as described above.
But we currently don't have the exception mechanism in the code and always use the sampling interval.
What you describe sounds like a perfect use case for Events, as opposed to DataChangeNotifications.
Events are discrete. So once they are thrown, they end up in the publication queue and no sampling is required.
Currently, the MonitoredItem can only test for value changes by invoking the read service and comparing the value with the last result.
However, the time between values returned to the Client shall be greater or equal to the sampling interval.
The MonitoredItem is not sufficiently sophisticated to deal with the simple case of two writers.
The UA specification (Part 4 - 5.12.1.5) states that MonitoredItems will maintain a queue of values to be transmitted, and new values will replace old values in the queue if the queue overflows. This specified algorithm completely solves this problem, even if the queue depth is 1.
In the sequence above the client is not aware that the value has changed in the server. The client has sent a 1 to the server, so it thinks, correctly, that the server contains a 1.
We could add special handling that checks whether a client is monitoring the value it just wrote into. I will discuss this possibility with the other developers.
Your use case may still covered by the current implementation. Just set the DataChangeTrigger of the MonitoredItem to Status+Value+Timestamp.