forked from ros2/design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New intra-process communication design (ros2#239)
Signed-off-by: Soragna, Alberto <alberto.soragna@gmail.com>
- Loading branch information
Showing
7 changed files
with
625 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@startuml | ||
|
||
participant Publisher | ||
participant IntraProcessManager | ||
participant IntraProcessImpl | ||
collections Subscriptions | ||
participant ROS_Middleware | ||
|
||
[-> Publisher: publish(unique_msg) | ||
|
||
Publisher -> Publisher : promote unique_msg \nto shared_msg | ||
|
||
Publisher -> IntraProcessManager : do_intra_process_publish(\nid, shared_msg) | ||
|
||
IntraProcessManager -> IntraProcessImpl : get_subscription_ids_for_pub(id) | ||
|
||
IntraProcessImpl --> IntraProcessManager : take_shared_ids, take_owned_ids | ||
|
||
note left | ||
these are lists of subscriptions | ||
with QoS compatible with publisher | ||
divided according to the type | ||
stored in their buffers | ||
end note | ||
|
||
loop for id : take_shared_ids | ||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(shared_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
alt take_ownership_ids.size() > 0 | ||
|
||
IntraProcessManager -> IntraProcessManager : copy shared_msg \n to unique_msg | ||
|
||
loop for id : take_owned_ids | ||
|
||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> IntraProcessManager : Copy unique_msg\n (except last iter) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(unique_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
end | ||
|
||
Publisher -> ROS_Middleware : do_inter_process_publish(shared_msg.get()) | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@startuml | ||
|
||
participant Publisher | ||
participant IntraProcessManager | ||
participant IntraProcessImpl | ||
collections Subscriptions | ||
|
||
[-> Publisher: publish(unique_msg) | ||
|
||
Publisher -> IntraProcessManager : do_intra_process_publish(\nid, unique_msg) | ||
|
||
IntraProcessManager -> IntraProcessImpl : get_subscription_ids_for_pub(id) | ||
|
||
IntraProcessImpl --> IntraProcessManager : take_shared_ids, take_owned_ids | ||
note left | ||
these are lists of subscriptions | ||
with QoS compatible with publisher | ||
divided according to the type | ||
stored in their buffers | ||
end note | ||
|
||
alt take_owned_ids.size() == 0 | ||
|
||
IntraProcessManager -> IntraProcessManager : promote unique_msg \nto shared_msg | ||
|
||
loop for id : take_shared_ids | ||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(shared_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
else take_owned_ids.size() > 0 && take_shared_ids.size() <= 1 | ||
|
||
loop for id : (take_shared_ids + take_owned_ids) | ||
|
||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> IntraProcessManager : Copy unique_msg\n (except last iter) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(unique_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
|
||
else take_owned_ids.size() > 0 && take_shared_ids.size() > 1 | ||
|
||
IntraProcessManager -> IntraProcessManager : copy unique_msg to shared_msg | ||
|
||
loop for id : take_shared_ids | ||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(shared_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
loop for id : take_owned_ids | ||
|
||
IntraProcessManager -> IntraProcessImpl : get_subscription(id) | ||
|
||
IntraProcessManager -> IntraProcessManager : Copy unique_msg\n (except last iter) | ||
|
||
IntraProcessManager -> Subscriptions : add_message_to_buffer(unique_msg) | ||
|
||
IntraProcessManager -> Subscriptions : trigger_guard_condition() | ||
end | ||
|
||
|
||
end | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.