Conversation
|
@mhmd-azeez Thanks for this! Some feedback. CompilationCacheThis code doesn't make it clear to me that the cache lifetime extends that of the runtime. The info in the Wazero code can offer inspiration: https://github.com/tetratelabs/wazero/blob/0dea5d7ee1de12d2817d6ac8548a4d36aaf59aea/cache.go#L64 Possible inspiration from Wazero examples: https://github.com/tetratelabs/wazero/blob/0dea5d7ee1de12d2817d6ac8548a4d36aaf59aea/examples/multiple-runtimes/counter.go CompiledPluginThe main reason to compile a plugin and later instantiate it is to allow for a plugin to be used across multiple goroutines as also mentioned in the code: Line 67 in b1e59a8 Line 112 in b1e59a8 The example Possible inspiration from Wazero examples: https://github.com/tetratelabs/wazero/blob/0dea5d7ee1de12d2817d6ac8548a4d36aaf59aea/examples/concurrent-instantiation/main.go
|
|
@johanjanssens thanks for the feedback, I have added a comment in the wazero cache section, and i have used goroutines in the compiled plugin section |
|
Thanks! This is looking good, ready to roll :) |
Related to #97
This PR documents
CompiledPlugin, it also adds a note clarifying the lifetime of a CompiledPlugin is tied to wazero cache if it's enabled