config.yml:<div><span style="font-family:arial,sans-serif;font-size:14px">> ElasticSearch:</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">> servers: "</span><a href="http://10.10.10.33:9200/" target="_blank" style="font-family:arial,sans-serif;font-size:14px">10.10.10.33:9200</a><span style="font-family:arial,sans-serif;font-size:14px">"</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">> transport: "httplite"</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">> max_requests: 10000</span><br style="font-family:arial,sans-serif;font-size:14px">
<span style="font-family:arial,sans-serif;font-size:14px">> trace_calls: 0</span><br style="font-family:arial,sans-serif;font-size:14px"><span style="font-family:arial,sans-serif;font-size:14px">> no_refresh: 0</span></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">lib/App.pm:</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>use lib "$Bin/../lib";</span></font></div><div>
<font face="arial, sans-serif"><span style="font-size:14px">>use App::A;</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>use App::B;</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">lib/App/A.pm:</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>use Dancer ':syntax';</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>use ElasticSearch;</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>my $elsearch = ElasticSearch->new( config->{ElasticSearch} );</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>prefix '/a';</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>get '/config' => sub { return Dumper $elsearch };</span></font></div><div><div><font face="arial, sans-serif"><span style="font-size:14px">lib/App/B.pm:</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>use Dancer ':syntax';</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>use ElasticSearch;</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>my $elsearch = ElasticSearch->new( config->{ElasticSearch} );</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">>prefix '/b';</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">>get '/config' => sub { return Dumper $elsearch };</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">Then `get <a href="http://localhost:3000/a/config`">http://localhost:3000/a/config`</a> show that servers: "<a href="http://10.10.10.33:9200">10.10.10.33:9200</a>" but `get <a href="http://localhost:3000/b/config`">http://localhost:3000/b/config`</a> show that servers: "<a href="http://127.0.0.1:9200">127.0.0.1:9200</a>" which is the default setting of ElasticSearch module.</span></font></div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/10 <span dir="ltr"><<a href="mailto:dancer-users-request@dancer.pm" target="_blank">dancer-users-request@dancer.pm</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send dancer-users mailing list submissions to<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:dancer-users-request@dancer.pm">dancer-users-request@dancer.pm</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:dancer-users-owner@dancer.pm">dancer-users-owner@dancer.pm</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of dancer-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Can I write own config in config.yml? (chenlin rao)<br>
2. Re: Can I write own config in config.yml? (David Precious)<br>
3. Re: Can I write own config in config.yml? (David Precious)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 10 Dec 2012 16:56:46 +0800<br>
From: chenlin rao <<a href="mailto:rao.chenlin@gmail.com">rao.chenlin@gmail.com</a>><br>
Subject: [dancer-users] Can I write own config in config.yml?<br>
To: <a href="mailto:dancer-users@perldancer.org">dancer-users@perldancer.org</a><br>
Message-ID:<br>
<CABwsoohczVCJwVxZcFUqPaS2KdxsK8-rE-V0=<a href="mailto:TeJEmDEPr4r5w@mail.gmail.com">TeJEmDEPr4r5w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
I try to write my own elasticsearch config in config.yml:<br>
<br>
ElasticSearch:<br>
servers: "<a href="http://10.10.10.33:9200" target="_blank">10.10.10.33:9200</a>"<br>
transport: "httplite"<br>
max_requests: 10000<br>
trace_calls: 0<br>
no_refresh: 0<br>
<br>
But after I got the right `config->{ElasticSearch}` in my<br>
lib/DancerApp/A.pm, I got `config->{ElasticSearch}` in my<br>
lib/DancerApp/B.pm returns only one line as 'trace_calls:0'.<br>
<br>
I try to got config->{appdir} at multi sub and got right result everywhere.<br>
<br>
Why??<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20121210/85f94448/attachment.html" target="_blank">http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20121210/85f94448/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 10 Dec 2012 10:46:51 +0000<br>
From: David Precious <<a href="mailto:davidp@preshweb.co.uk">davidp@preshweb.co.uk</a>><br>
Subject: Re: [dancer-users] Can I write own config in config.yml?<br>
To: Perl Dancer users mailing list <<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>>,<br>
<a href="mailto:dancer-users@perldancer.org">dancer-users@perldancer.org</a><br>
Message-ID: <20121210104651.65d2c92f@columbia><br>
Content-Type: text/plain; charset=US-ASCII<br>
<br>
On Mon, 10 Dec 2012 16:56:46 +0800<br>
chenlin rao <<a href="mailto:rao.chenlin@gmail.com">rao.chenlin@gmail.com</a>> wrote:<br>
<br>
> I try to write my own elasticsearch config in config.yml:<br>
><br>
> ElasticSearch:<br>
> servers: "<a href="http://10.10.10.33:9200" target="_blank">10.10.10.33:9200</a>"<br>
> transport: "httplite"<br>
> max_requests: 10000<br>
> trace_calls: 0<br>
> no_refresh: 0<br>
<br>
That looks fine.<br>
<br>
> But after I got the right `config->{ElasticSearch}` in my<br>
> lib/DancerApp/A.pm, I got `config->{ElasticSearch}` in my<br>
> lib/DancerApp/B.pm returns only one line as 'trace_calls:0'.<br>
><br>
> I try to got config->{appdir} at multi sub and got right result<br>
> everywhere.<br>
><br>
> Why??<br>
<br>
Can you show your code? config->{ElasticSearch} should give you the<br>
same in each case, unless it's being modified by something.<br>
<br>
<br>
--<br>
David Precious ("bigpresh") <<a href="mailto:davidp@preshweb.co.uk">davidp@preshweb.co.uk</a>><br>
<a href="http://www.preshweb.co.uk/" target="_blank">http://www.preshweb.co.uk/</a> <a href="http://www.preshweb.co.uk/twitter" target="_blank">www.preshweb.co.uk/twitter</a><br>
<a href="http://www.preshweb.co.uk/linkedin" target="_blank">www.preshweb.co.uk/linkedin</a> <a href="http://www.preshweb.co.uk/facebook" target="_blank">www.preshweb.co.uk/facebook</a><br>
<a href="http://www.preshweb.co.uk/cpan" target="_blank">www.preshweb.co.uk/cpan</a> <a href="http://www.preshweb.co.uk/github" target="_blank">www.preshweb.co.uk/github</a><br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 10 Dec 2012 10:46:51 +0000<br>
From: David Precious <<a href="mailto:davidp@preshweb.co.uk">davidp@preshweb.co.uk</a>><br>
Subject: Re: [dancer-users] Can I write own config in config.yml?<br>
To: Perl Dancer users mailing list <<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>>,<br>
<a href="mailto:dancer-users@perldancer.org">dancer-users@perldancer.org</a><br>
Message-ID: <20121210104651.65d2c92f@columbia><br>
Content-Type: text/plain; charset=US-ASCII<br>
<br>
On Mon, 10 Dec 2012 16:56:46 +0800<br>
chenlin rao <<a href="mailto:rao.chenlin@gmail.com">rao.chenlin@gmail.com</a>> wrote:<br>
<br>
> I try to write my own elasticsearch config in config.yml:<br>
><br>
> ElasticSearch:<br>
> servers: "<a href="http://10.10.10.33:9200" target="_blank">10.10.10.33:9200</a>"<br>
> transport: "httplite"<br>
> max_requests: 10000<br>
> trace_calls: 0<br>
> no_refresh: 0<br>
<br>
That looks fine.<br>
<br>
> But after I got the right `config->{ElasticSearch}` in my<br>
> lib/DancerApp/A.pm, I got `config->{ElasticSearch}` in my<br>
> lib/DancerApp/B.pm returns only one line as 'trace_calls:0'.<br>
><br>
> I try to got config->{appdir} at multi sub and got right result<br>
> everywhere.<br>
><br>
> Why??<br>
<br>
Can you show your code? config->{ElasticSearch} should give you the<br>
same in each case, unless it's being modified by something.<br>
<br>
<br>
--<br>
David Precious ("bigpresh") <<a href="mailto:davidp@preshweb.co.uk">davidp@preshweb.co.uk</a>><br>
<a href="http://www.preshweb.co.uk/" target="_blank">http://www.preshweb.co.uk/</a> <a href="http://www.preshweb.co.uk/twitter" target="_blank">www.preshweb.co.uk/twitter</a><br>
<a href="http://www.preshweb.co.uk/linkedin" target="_blank">www.preshweb.co.uk/linkedin</a> <a href="http://www.preshweb.co.uk/facebook" target="_blank">www.preshweb.co.uk/facebook</a><br>
<a href="http://www.preshweb.co.uk/cpan" target="_blank">www.preshweb.co.uk/cpan</a> <a href="http://www.preshweb.co.uk/github" target="_blank">www.preshweb.co.uk/github</a><br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br>
<br>
End of dancer-users Digest, Vol 34, Issue 3<br>
*******************************************<br>
</blockquote></div><br></div>