Skip to content

Commit

Permalink
renamed plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Jan 3, 2024
1 parent 8528cee commit c61a6bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Option `buildAll` for Suggesters
- NoResponseRequest Plugin
- NoWaitForResponseRequest Plugin

### Fixed
- PHP 8.2 deprecations for Solarium\QueryType\Server\Collections results
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use Solarium\Plugin\CustomizeRequest\CustomizeRequest;
use Solarium\Plugin\Loadbalancer\Loadbalancer;
use Solarium\Plugin\MinimumScoreFilter\MinimumScoreFilter;
use Solarium\Plugin\NoResponseRequest;
use Solarium\Plugin\NoWaitForResponseRequest;
use Solarium\Plugin\ParallelExecution\ParallelExecution;
use Solarium\Plugin\PostBigExtractRequest;
use Solarium\Plugin\PostBigRequest;
Expand Down Expand Up @@ -244,7 +244,7 @@ class Client extends Configurable implements ClientInterface
*/
protected $pluginTypes = [
'loadbalancer' => Loadbalancer::class,
'noresponserequest' => NoResponseRequest::class,
'nowaitforresponserequest' => NoWaitForResponseRequest::class,
'postbigrequest' => PostBigRequest::class,
'postbigextractrequest' => PostBigExtractRequest::class,
'customizerequest' => CustomizeRequest::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
use Solarium\Exception\HttpException;

/**
* NoResponseRequest plugin.
* NoWaitForResponseRequest plugin.
*
* Long-running requests like suggest.buildAll might exceed timeouts.
* This plugin "tries" to convert the request in a kind of fire-and-forget.
* Most reliable if using the Curl adapter.
*/
class NoResponseRequest extends AbstractPlugin
class NoWaitForResponseRequest extends AbstractPlugin
{
/**
* Event hook to adjust client settings just before query execution.
Expand Down Expand Up @@ -90,7 +90,7 @@ protected function initPluginType()
{
$dispatcher = $this->client->getEventDispatcher();
if (is_subclass_of($dispatcher, '\Symfony\Component\EventDispatcher\EventDispatcherInterface')) {
// NoResponseRequest has to act on PRE_EXECUTE_REQUEST before Loadbalancer (priority 0)
// NoWaitForResponseRequest has to act on PRE_EXECUTE_REQUEST before Loadbalancer (priority 0)
// and after PostBigRequest (priority 10). Set priority to 5.
$dispatcher->addListener(Events::PRE_EXECUTE_REQUEST, [$this, 'preExecuteRequest'], 5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
use Solarium\Core\Client\Request;
use Solarium\Core\Event\Events;
use Solarium\Core\Event\PreExecuteRequest as PreExecuteRequestEvent;
use Solarium\Plugin\NoResponseRequest;
use Solarium\Plugin\NoWaitForResponseRequest;
use Solarium\QueryType\Select\Query\Query;
use Solarium\Tests\Integration\TestClientFactory;

class NoResponseRequestTest extends TestCase
class NoWaitForResponseRequestTest extends TestCase
{
/**
* @var \Solarium\Plugin\NoResponseRequest
* @var \Solarium\Plugin\NoWaitForResponseRequest
*/
protected $plugin;

Expand All @@ -33,16 +33,16 @@ class NoResponseRequestTest extends TestCase
public function setUp(): void
{
$this->client = TestClientFactory::createWithCurlAdapter();
$this->plugin = $this->client->getPlugin('noresponserequest');
$this->plugin = $this->client->getPlugin('nowaitforresponserequest');
$this->query = $this->client->createSuggester(['buildAll' => true]);
}

public function testInitPlugin(): Client
{
$client = TestClientFactory::createWithCurlAdapter();
$plugin = $client->getPlugin('noresponserequest');
$plugin = $client->getPlugin('nowaitforresponserequest');

$this->assertInstanceOf(NoResponseRequest::class, $plugin);
$this->assertInstanceOf(NoWaitForResponseRequest::class, $plugin);

$expectedListeners = [
Events::PRE_EXECUTE_REQUEST => [
Expand All @@ -66,7 +66,7 @@ public function testInitPlugin(): Client
*/
public function testDeinitPlugin(Client $client)
{
$client->removePlugin('noresponserequest');
$client->removePlugin('nowaitforresponserequest');

$this->assertSame(
[],
Expand Down Expand Up @@ -99,7 +99,7 @@ public function testExecuteRequest()
public function testPluginIntegration()
{
$client = TestClientFactory::createWithCurlAdapter();
$plugin = new NoResponseRequest();
$plugin = new NoWaitForResponseRequest();
$client->registerPlugin('testplugin', $plugin);

$query = $client->createSelect();
Expand Down

0 comments on commit c61a6bf

Please sign in to comment.