Skip to content

Commit 9938ad9

Browse files
author
yuchen966
committed
fix format
1 parent 998d964 commit 9938ad9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/Tutorials/Demos/Intra-Process-Communication.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ In this case, since they only come once per second, usually only the first messa
163163
Finally, you can see that "Published message..." and "Received message ..." lines with the same value also have the same address.
164164
This shows that the address of the message being received is the same as the one that was published and that it is not a copy.
165165
This is because we're publishing and subscribing with ``std::unique_ptr``\ s which allow ownership of a message to be moved around the system safely.
166+
166167
Understanding publish() behavior with different message types
167168
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168169

@@ -178,7 +179,7 @@ The behavior of the ``publish()`` function varies depending on the message type
178179
- Ownership is moved from publisher to the first subscriber
179180
- This is the recommended approach for intra-process communication
180181

181-
**Raw messages (both ``msg`` and ``std::move(msg)``):**
182+
**Raw messages** (both ``msg`` and ``std::move(msg)``):
182183
- Both result in copying
183184
- No zero-copy benefits are obtained
184185
- Use ``const &`` for subscription callbacks with raw messages
@@ -398,7 +399,7 @@ When a ``unique_ptr`` message is published and there are multiple intra-process
398399
- This applies regardless of whether subscribers use ``unique_ptr`` or ``shared_ptr`` callbacks
399400

400401
Note that the image view nodes are not subscribed with ``unique_ptr`` callbacks.
401-
Instead they are subscribed with ``const shared_ptr``s.
402+
Instead they are subscribed with ``const shared_ptr`` s.
402403
This means the system delivers the original message to the first callback and copies to subsequent callbacks.
403404
When the first intraprocess subscription is handled, the internally stored ``unique_ptr`` is promoted to a ``shared_ptr`` for delivery to multiple subscribers.
404405

0 commit comments

Comments
 (0)