Closed heaxo closed 1 year ago
Check out the bidirectional example: https://github.com/hashicorp/go-plugin/tree/main/examples/bidirectional
The main application exposes a gRPC service (AddHelper
) to the plugin and the plugin can call that service's methods. In the example it only calls that method in response to plugin RPCs, but a long lived plugin can keep a connection to the service and call it whenever it likes. For example, Vault exposes a storage service to plugins and some plugins use that to access storage from background processing routines.
@tomhjp Thanks
How can sub plugins proactively initiate requests to the main application? The example I see is the main application plugin. NewClient, which calls the methods of the sub plugin through the client. How to call the methods of the main application in the sub plugin