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

[Question] What is the sequence diagram using the readme interface example ? #112

Open
bioinfornatics opened this issue Sep 12, 2023 · 0 comments

Comments

@bioinfornatics
Copy link

bioinfornatics commented Sep 12, 2023

Dear,

Thanks for your works,
I am trying to understand how this crate works, thus I have some questions:

  1. At which time the plugin .so file is loaded ?
  2. about of load_from_directory function used into the example interface line 54 , what do this function. Does it try to load any .so file from given directory ?

Below my actual and fuzzy understanding

sequenceDiagram
participant App
participant MyPluginInterface
participant MyPlugin
participant RootModule as  abi_stable::library::RootModule
App ->> MyPluginInterface : use specialized defined API
MyPluginInterface ->> MyPlugin : call load_from_directory
MyPlugin ->> RootModule : call load_from_directory
RootModule  -> MysharedLib : load .so file
Loading

I would like to achieve something like:
An App which define various interfaces to let other dev extend the app via various plugins
So, the App do not know implementations (i.e the plugins) but know that plugins are all located into my/plugin/dir
The App loop over plugin into my/plugin/dir and load them

What it is blocking while reading example ?
In readme_example The readme_user app use readme_interface which implement RootModule
To my understanding at this step the interface define the plugin name that would mean into one directory only one plugin using this interface is possible, no ?

Edit: for the last part I think I understood, I should not create 1 interface by plugin but 1 interface for all kind of plugin and use the same way describe into 1_trait_objects

Thanks for your insight

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

No branches or pull requests

1 participant