Rename Reader to Consumer and Writer to Producer

This commit is contained in:
2021-01-23 01:35:09 +03:00
parent bf738254b1
commit 6eeb2939c8
7 changed files with 27 additions and 25 deletions

View File

@ -3,9 +3,9 @@
declare(strict_types=1);
use Nsq\Message;
use Nsq\Reader;
use Nsq\Consumer;
use Nsq\Subscriber;
use Nsq\Writer;
use Nsq\Producer;
use Nsq\Exception;
use PHPUnit\Framework\TestCase;
@ -13,10 +13,10 @@ final class NsqTest extends TestCase
{
public function test(): void
{
$writer = new Writer('tcp://localhost:4150');
$writer = new Producer('tcp://localhost:4150');
$writer->pub(__FUNCTION__, __FUNCTION__);
$reader = new Reader('tcp://localhost:4150');
$reader = new Consumer('tcp://localhost:4150');
$subscriber = new Subscriber($reader);
$generator = $subscriber->subscribe(__FUNCTION__, __FUNCTION__, 1);
@ -85,7 +85,7 @@ final class NsqTest extends TestCase
$this->expectException(Exception::class);
$this->expectExceptionMessage($exceptionMessage);
$writer = new Writer('tcp://localhost:4150');
$writer = new Producer('tcp://localhost:4150');
$writer->pub($topic, $body);
}