ramv / node-elastical

Node.js client for the ElasticSearch REST API.
MIT License
105 stars 19 forks source link

set request options #1

Closed Filirom1 closed 12 years ago

Filirom1 commented 12 years ago

Hi,

I would like to change the default agent of Elastical to this one : https://github.com/TBEDP/agentkeepalive

To do it, I need to set request options.

var Agent = require('agentkeepalive');

var keepaliveAgent = new Agent({
  maxSockets: 10,
  maxKeepAliveRequests: 0, // max requests per keepalive socket, default is 0, no limit.
  maxKeepAliveTime: 30000 // keepalive for 30 seconds
});

var client = new elastical.Client({agent: keepaliveAgent })

I set a list of allowed options, tell me if it's ok for you :

[ 'timeout',
  'pool',
  'agent',
  'headers',
  'followRedirect',
  'followAllRedirects',
  'proxy',
  'oauth',
  'strictSSL',
  'jar']

Cheers Romain

ramv commented 12 years ago

The dependency in package.json is missing. Can you please add it?

Filirom1 commented 12 years ago

I dont want elastical to include the agentkeepalive.

I want to be able to include it in my app, via the options.

Take a look at the code, the test I added is an other use case.

Filirom1 commented 12 years ago

Is there a chance to have a new elastical version on npm with this PR ?

Thank you Romain

ramv commented 12 years ago

yes. I will try to get this done today.

On Mon, Oct 29, 2012 at 3:26 AM, Romain notifications@github.com wrote:

Is there a chance to have a new elastical version on npm with this PR ?

Thank you Romain

— Reply to this email directly or view it on GitHubhttps://github.com/ramv/node-elastical/pull/1#issuecomment-9861631.

Best Regards,

Ram Viswanadha

Filirom1 commented 12 years ago

Thanks

2012/10/29 Ram Viswanadha notifications@github.com

yes. I will try to get this done today.

On Mon, Oct 29, 2012 at 3:26 AM, Romain notifications@github.com wrote:

Is there a chance to have a new elastical version on npm with this PR ?

Thank you Romain

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9861631>.

Best Regards,

Ram Viswanadha

— Reply to this email directly or view it on GitHubhttps://github.com/ramv/node-elastical/pull/1#issuecomment-9865396.

ramv commented 12 years ago

hey guys,

I merged the pull request and released version 0.0.10.

On Mon, Oct 29, 2012 at 6:15 AM, Romain notifications@github.com wrote:

Thanks

2012/10/29 Ram Viswanadha notifications@github.com

yes. I will try to get this done today.

On Mon, Oct 29, 2012 at 3:26 AM, Romain notifications@github.com wrote:

Is there a chance to have a new elastical version on npm with this PR ?

Thank you Romain

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9861631>.

Best Regards,

Ram Viswanadha

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9865396>.

— Reply to this email directly or view it on GitHubhttps://github.com/ramv/node-elastical/pull/1#issuecomment-9865619.

Best Regards,

Ram Viswanadha

Filirom1 commented 12 years ago

Good news.

Thanks

Le vendredi 2 novembre 2012, Ram Viswanadha a écrit :

hey guys,

I merged the pull request and released version 0.0.10.

On Mon, Oct 29, 2012 at 6:15 AM, Romain <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>> wrote:

Thanks

2012/10/29 Ram Viswanadha <notifications@github.com <javascript:_e({}, 'cvml', 'notifications@github.com');>>

yes. I will try to get this done today.

On Mon, Oct 29, 2012 at 3:26 AM, Romain <notifications@github.com<javascript:_e({}, 'cvml', 'notifications@github.com');>>

wrote:

Is there a chance to have a new elastical version on npm with this PR ?

Thank you Romain

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9861631>.

Best Regards,

Ram Viswanadha

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9865396>.

— Reply to this email directly or view it on GitHub< https://github.com/ramv/node-elastical/pull/1#issuecomment-9865619>.

Best Regards,

Ram Viswanadha

— Reply to this email directly or view it on GitHubhttps://github.com/ramv/node-elastical/pull/1#issuecomment-10003109.