Chaging adhearsion config with out restarting adhearsion application

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Chaging adhearsion config with out restarting adhearsion application

vijay
Hi,

I would like to know if running Adhearsion application config can be changed without restarting the application.  

I understand that SIGALRM can be used to toggle on or off TRACE level logging. Similarly, can any other signal can be used to force the Adhearsion application to re read the config.

Thanks 
Vijay

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Chaging adhearsion config with out restarting adhearsion application

Stephen George
Hello Vijay,

My suggestion would be to consider adding http endpoints to your adhearsion application to allow you to manipulate various config settings of the Adhearsion core config as well as for Adhearsion plugins.

The Virginia gem allows you to easily bolt-on a Reel based web server to Adhearsion.  Any endpoints you add to Virginia will be running in the same process as Adhearsion, and thus can easily manipulate configuration.

Virginia supports any rack-based web framework.  Here's an example endpoint using Sinatra:


require 'sinatra/base'

put '/default_voice' do
  Adhearsion.config.media.default_voice = params[:default_voice] if params[:default_voice]
  standard_response "default_voice changed to #{Adhearsion.config.media.default_voice}.\n"
end

# Sinatra helpers
helpers do
  def standard_response(response, status_code = 200, headers = {})
    [status_code, headers, [response]]
  end
end


You could invoke this externally using a program like cURL like so:

curl -f -s -S -H 'Accept: application/json' -X PUT -d 'default_voice=Larry' http://localhost:8080/default_voice

#=> default_voice changed to Larry.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Chaging adhearsion config with out restarting adhearsion application

Luca Pradovera
Hello,
additionally, the current version fo Adhearsion 3 (release coming soon, I promise!) bundles a more advanced version of the HTTP server right in the main library. You can just add your actions to config.ru in the familiar Sinatra syntax.

Best regards,
Luca

On Tue, Jan 29, 2019 at 1:43 PM Stephen F. George <[hidden email]> wrote:
Hello Vijay,

My suggestion would be to consider adding http endpoints to your adhearsion application to allow you to manipulate various config settings of the Adhearsion core config as well as for Adhearsion plugins.

The Virginia gem allows you to easily bolt-on a Reel based web server to Adhearsion.  Any endpoints you add to Virginia will be running in the same process as Adhearsion, and thus can easily manipulate configuration.

Virginia supports any rack-based web framework.  Here's an example endpoint using Sinatra:


require 'sinatra/base'

put '/default_voice' do
  Adhearsion.config.media.default_voice = params[:default_voice] if params[:default_voice]
  standard_response "default_voice changed to #{Adhearsion.config.media.default_voice}.\n"
end

# Sinatra helpers
helpers do
  def standard_response(response, status_code = 200, headers = {})
    [status_code, headers, [response]]
  end
end


You could invoke this externally using a program like cURL like so:

curl -f -s -S -H 'Accept: application/json' -X PUT -d 'default_voice=Larry' http://localhost:8080/default_voice

#=> default_voice changed to Larry.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Chaging adhearsion config with out restarting adhearsion application

vijay
In reply to this post by Stephen George
Thank you Stephen.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Chaging adhearsion config with out restarting adhearsion application

vijay
In reply to this post by Luca Pradovera
Thank you Luca. Great news.., looking forward to Adhearsion 3 release.


On Wednesday, 30 January 2019 00:41:42 UTC+11, Polysics wrote:
Hello,
additionally, the current version fo Adhearsion 3 (release coming soon, I promise!) bundles a more advanced version of the HTTP server right in the main library. You can just add your actions to <a href="http://config.ru" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fconfig.ru\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGNk21l5vNnkEUuhZ94CbiUdeHNBA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fconfig.ru\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGNk21l5vNnkEUuhZ94CbiUdeHNBA&#39;;return true;">config.ru in the familiar Sinatra syntax.

Best regards,
Luca

On Tue, Jan 29, 2019 at 1:43 PM Stephen F. George <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="EqPxJY3DFwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sfge...@...> wrote:
Hello Vijay,

My suggestion would be to consider adding http endpoints to your adhearsion application to allow you to manipulate various config settings of the Adhearsion core config as well as for Adhearsion plugins.

<a href="https://github.com/adhearsion/virginia" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fadhearsion%2Fvirginia\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNERHkqOYMBO3scccLRIb24GmB4TAQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fadhearsion%2Fvirginia\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNERHkqOYMBO3scccLRIb24GmB4TAQ&#39;;return true;">The Virginia gem allows you to easily bolt-on a Reel based web server to Adhearsion.  Any endpoints you add to Virginia will be running in the same process as Adhearsion, and thus can easily manipulate configuration.

Virginia supports any rack-based web framework.  Here's an example endpoint using Sinatra:


require 'sinatra/base'

put '/default_voice' do
  Adhearsion.config.media.default_voice = params[:default_voice] if params[:default_voice]
  standard_response "default_voice changed to #{Adhearsion.config.media.default_voice}.\n"
end

# Sinatra helpers
helpers do
  def standard_response(response, status_code = 200, headers = {})
    [status_code, headers, [response]]
  end
end


You could invoke this externally using a program like cURL like so:

curl -f -s -S -H 'Accept: application/json' -X PUT -d 'default_voice=Larry' <a href="http://localhost:8080/default_voice" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A8080%2Fdefault_voice\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGER2opbB666uVjgMEIwBzd6_HxMg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A8080%2Fdefault_voice\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGER2opbB666uVjgMEIwBzd6_HxMg&#39;;return true;">http://localhost:8080/default_voice

#=> default_voice changed to Larry.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="EqPxJY3DFwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">adhearsion+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Chaging adhearsion config with out restarting adhearsion application

Andrius Kairiukstis
In reply to this post by Stephen George
Awesome, I did not knew that it works that way; only use Virginia to add api capabilities 

On 29 January 2019 at 13:42:28, Stephen F. George ([hidden email]) wrote:

Hello Vijay,

My suggestion would be to consider adding http endpoints to your adhearsion application to allow you to manipulate various config settings of the Adhearsion core config as well as for Adhearsion plugins.

The Virginia gem allows you to easily bolt-on a Reel based web server to Adhearsion.  Any endpoints you add to Virginia will be running in the same process as Adhearsion, and thus can easily manipulate configuration.

Virginia supports any rack-based web framework.  Here's an example endpoint using Sinatra:


require 'sinatra/base'

put '/default_voice' do
  Adhearsion.config.media.default_voice = params[:default_voice] if params[:default_voice]
  standard_response "default_voice changed to #{Adhearsion.config.media.default_voice}.\n"
end

# Sinatra helpers
helpers do
  def standard_response(response, status_code = 200, headers = {})
    [status_code, headers, [response]]
  end
end


You could invoke this externally using a program like cURL like so:

curl -f -s -S -H 'Accept: application/json' -X PUT -d 'default_voice=Larry' http://localhost:8080/default_voice

#=> default_voice changed to Larry.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.