elasticsearch
elasticsearch copied to clipboard
added debug handler: ElasticSearch\Client::addOnCallHandler
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.
Thanks. I'd appreciate a few small changes before merging:
- Change the
public $onCall
to aprotected $onCall = array()
. I don't want this exposed - Preferably add typehinting in the method for adding a listener
- I would prefer a method name like
onCall
- Add some basic tests to prove its working
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
Just that I think a method named onCall(callable $handler)
would be better than addOnCallHandler($handler)