Added the ability for a plugin to specify an initialization routine that
is only executed when the SiriProxy server is started. This provides the
plugin a mechanism to perform a task that is not required to be
performed upon every connection. This is an optional feature, so existing plugins won't break.
Usage
Plugin defines a function called "plugin_init" to be called once when the server is started.
def plugin_init
init_data = Hash.new
# dynamically collect info into "init_data"
return init_data
end
Function "plugin_init" should return initialization data to be used on future connections.
In plugin "initialize" (constructor) function, plugin can access saved initialization data from passed "config" hash.
def initialize(config)
if (config.has_key?("init"))
# plugin has been initialized, use config['init'] to access "init_data"
else
# plugin is being called on server start
end
end
Usefulness
For plugins that require processing time to dynamically collect static data (information about a home automation system, for example)
Added the ability for a plugin to specify an initialization routine that is only executed when the SiriProxy server is started. This provides the plugin a mechanism to perform a task that is not required to be performed upon every connection. This is an optional feature, so existing plugins won't break.
Usage
Usefulness