Skip to content

Add loaned message support to R2R#42

Merged
m-dahl merged 1 commit intosequenceplanner:masterfrom
wayveai:liyou/loaned_message_support
Mar 21, 2023
Merged

Add loaned message support to R2R#42
m-dahl merged 1 commit intosequenceplanner:masterfrom
wayveai:liyou/loaned_message_support

Conversation

@LiyouZhou
Copy link
Copy Markdown
Contributor

Add loaned message support in R2R's subscriber to
take advantage of the shared memory backend of the middleware.

  • Add new constructor to WrappedNativeMsg which takes a already allocated pointer, and a deallocator.
  • If the subscription can loan messages, construct WrappedNativeMsg with the loaned message pointer.
  • Pass in also a closure as the deallocator that calls the right APIs to return the loaned message to the middleware layer.
  • The deallocator is called in the destructor of WrappedNativeMsg
  • Add borrow_loaned_message API to publisher
  • Add release() api to WrappedNativeMsg so a loaded message could be manually released if not published.

Add loaned message support in R2R's subscriber to
take advantage of the shared memory backend of the middleware.

- Add new constructor to `WrappedNativeMsg` which
  takes a already allocated pointer, and a deallocator.
- If the subscription can loan messages, construct
  `WrappedNativeMsg` with the loaned message pointer.
- Pass in also a closure  as the deallocator that calls
  the right APIs to return the loaned message to the middleware layer.
- The deallocator is called in the destructor of `WrappedNativeMsg`
- Add borrow_loaned_message API to publisher
- Add release() api to WrappedNativeMsg so a loaded message
  could be manually released if not published.
@m-dahl
Copy link
Copy Markdown
Collaborator

m-dahl commented Mar 21, 2023

Wow new feature :) That's cool. I think the patch looks good. Nice that you are finding use for the "native" messages.

@m-dahl m-dahl merged commit c092123 into sequenceplanner:master Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants