Skip to content
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Fix documentation and examples to show simplified usage#22

Open
pepinns wants to merge 1 commit into
ayourtch:mainfrom
pepinns:fix-docs
Open

Fix documentation and examples to show simplified usage#22
pepinns wants to merge 1 commit into
ayourtch:mainfrom
pepinns:fix-docs

Conversation

@pepinns

@pepinns pepinns commented Nov 16, 2021

Copy link
Copy Markdown
Contributor
  • fix documentation to show simplified usage
  • update example to use new functions

@pepinns

pepinns commented Nov 16, 2021

Copy link
Copy Markdown
Contributor Author

None of this will work of course until the macros are updated.

@ayourtch

Copy link
Copy Markdown
Owner

So, I had time to toy with this a little bit, and I think it is not a very good idea to throw more send/recv functionality into the generated crate, so I will try to get away from it.

The reason is: in the client project using the generated latest-vpp-api, one needs to include vpp-api-transport, in order to open the needed connection.

The moment the client attempts to use a different version of vpp-api-transport that the latest-vpp-api uses, we have a problem due to multiple definitions of the symbols...

Ideally I would like to complely get rid of dependency on transport in the generated API crate, and stuff the send/recv logic into some kind of "behavior" crate.

I think I will try to create a separate crate "vpp-api-message-crc" just to hold the trait (since it will be pretty much static), then reference that crate in both generated API crate and the "behavior" crate.

Now, since the end user will deal with the "behavior" crate as well - looks like we have just moved the same problem there...

So, probably the same trick should be applied to transport: keep the trait definition in the vpp-api-transport, and then have af_unix and shmem implementations in separate crates (again, this should help with modularity, since someone can then write a better version of transports, e.g. with not using the shared library altogether).

@ayourtch

Copy link
Copy Markdown
Owner

I will try a modified approach: pull out the message name+crc trait definition into an outside crate as i said, but move the send/recv function into the vpp-api-transport crate. this will solve the dependency problem without creating a zoo of crates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants