Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New intra-process communication design #239

Merged
merged 8 commits into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
498 changes: 498 additions & 0 deletions articles/intraprocess_communication.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions img/intraprocess_communication/intra_inter_process.txt
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.
74 changes: 74 additions & 0 deletions img/intraprocess_communication/intra_process_only.txt
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
Binary file added img/intraprocess_communication/new_ipc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/intraprocess_communication/old_ipc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.