elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

added debug handler: ElasticSearch\Client::addOnCallHandler

Open juzna opened this issue 11 years ago • 3 comments

It is possible to register a callback, which gets called every time a request to ElasticSearch is made.

It makes possible to create debug tools, such as this debug bar for Nette Fw. debug bar example

juzna avatar Jun 04 '13 11:06 juzna

Thanks. I'd appreciate a few small changes before merging:

  1. Change the public $onCall to a protected $onCall = array(). I don't want this exposed
  2. Preferably add typehinting in the method for adding a listener
  3. I would prefer a method name like onCall
  4. Add some basic tests to prove its working

nervetattoo avatar Jun 04 '13 12:06 nervetattoo

Hi Raymond, thanks for the feedback! I don't understand what you mean by the third step, can you please give me a better hint? Thx

juzna avatar Jun 04 '13 12:06 juzna

Just that I think a method named onCall(callable $handler) would be better than addOnCallHandler($handler)

nervetattoo avatar Jun 04 '13 13:06 nervetattoo