Is there somewhere explained how exactly does the plugin lifecycle look like?
- How are static fields handled? (is assembly unloaded between plugin runs?)
- How are thread static fields handled? (is new thread created for each plugin run?)
- How are instance fields handled? (are new instances of plugin created on each run?)
- What is the preferred way to perform clean shutdown? So far I came with this (written from memory, might not be functional code)
How does archebuddy identify the correct assembly with plugin in plugins dir?
Should the "Core" class be used for all classes that need to call it's methods or it's just for the main "plugin" and I should pass reference / store it in static field to other classes that are not the main plugin? Why is this class not static? And just out of curiosity - what you guys have against c# naming conventions? It feels like you are trying to use c# for functional programming - woudln't f# be better for that?
Thanks
- How are static fields handled? (is assembly unloaded between plugin runs?)
- How are thread static fields handled? (is new thread created for each plugin run?)
- How are instance fields handled? (are new instances of plugin created on each run?)
- What is the preferred way to perform clean shutdown? So far I came with this (written from memory, might not be functional code)
PHP:
private volatile ManualResetEvent m_stopping;
public void PluginRun()
{
try
{
// init
while (m_stopping == null)
{
// plugin loop
}
m_stopping.Set();
}
catch (Exception ex)
{
if (m_stopping == null)
m_stopping = new ManualResetEvent(true);
else
m_stopping.Set();
throw;
}
}
public void PluginStop()
{
using (m_stopping = m_stopping ?? new ManualResetEvent(false))
{
m_stopping.WaitOne(TimeSpan.FromSeconds(30));
}
m_stopping = null;
// more cleanup
}
How does archebuddy identify the correct assembly with plugin in plugins dir?
Should the "Core" class be used for all classes that need to call it's methods or it's just for the main "plugin" and I should pass reference / store it in static field to other classes that are not the main plugin? Why is this class not static? And just out of curiosity - what you guys have against c# naming conventions? It feels like you are trying to use c# for functional programming - woudln't f# be better for that?
Thanks






