IssueRaiser

plugin: add support for closing plugins

Adding support for closing plugins would give a simple way to do hot code reloading in long running applications like web servers. This would add another method to `src/plugin/plugin.go` and a new file `src/plugin/dl_close.go` that would handle closing the dlhandle and destroying the go symbol map. It would also add the handle as an un-exported unsafe pointer to the go plugin struct. The main issue is how to signal that a plugin has been closed without breaking API compatibility. Currently the plugin has a channel called `loaded` which is closed when the plugin is loaded. The simplest solution is to add another channel which is closed when the plugin is closed, however this doesn't seem very 'neat' to me.

Posted by zacps on May 22, 2017, 10:54 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

support (Other)

plugin: add support for closing plugins

zacpsMay 22, 2017, 10:54 PM

Adding support for closing plugins would give a simple way to do hot code reloading in long running applications like web servers. This would add another method to `src/plugin/plugin.go` and a new file `src/plugin/dl_close.go` that would handle closing the dlhandle and destroying the go symbol map. It would also add the handle as an un-exported unsafe pointer to the go plugin struct. The main issue is how to signal that a plugin has been closed without breaking API compatibility. Currently the plugin has a channel called `loaded` which is closed when the plugin is loaded. The simplest solution is to add another channel which is closed when the plugin is closed, however this doesn't seem very 'neat' to me.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue