You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(op bunching) Added logic to process messages in a bunch in SharedObject (#23836)
This PR adds support for DDSes to process a 'bunch' of messages. Op
bunching was added via the following PRs:
#22839,
#22840 and
#22841.
Added a `processMessagesCore` function to `SharedObjectCore` that DDSes
can override to process a message bunch. This is marked optional today
because it's a breaking change. It is similar to the `processCore`
function and will replace it eventually. For now, `processCore` has been
marked as deprecated.
This change updates the relative ordering of the `pre-op` and `op`
events emitted by the shared object. Previously, the `pre-op` event
would be emitted before a message was processed and `op` event was
emitted immediately afterwards. With this change, the ordering of these
events w.r.t. to the message being processed is still the same. However,
there may be other ops processed and other event fired in between.
Note that the only guarantee these events provide is that the `pre-op`
event is emitted before a message is procesed and the `op` event is
processed after. So, this change doesn't break that guarantee.
Change when the `pre-op` and `op` events on `ISharedObjectEvents` are emitted
9
+
10
+
Previous behavior - `pre-op` was emitted immediately before an op was processed. Then the op was processed and `op` was emitted immediately after that.
11
+
12
+
New behavior - `pre-op` will still be emitted before an op is processed and `op` will still be emitted after an op is processed. However, these won't be immediate and other ops in a batch for the shared object may be processed in between.
13
+
14
+
Note that these events are for internal use only as mentioned in the @remarks section of their definition.
Deprecate `processCore` on `SharedObject` and `SharedObjectCore` in favor of `processMessagesCore`
9
+
10
+
A new function `processMessagesCore` has been added in place of `processCore`, which will be called to process multiple messages instead of a single one on the channel. This is part of a feature called "Op bunching" where contiguous ops in a grouped batch are bunched and processed together by the shared object.
11
+
12
+
Implementations of `SharedObject` and `SharedObjectCore` must now also implement `processMessagesCore`. A basic implementation could be to iterate over the messages' content and process them one by one as it happens now. Note that some DDS may be able to optimize processing by processing the messages together.
0 commit comments