Skip to content

Commit

Permalink
Hotfix: Allow for MessageBag as well as a single Message
Browse files Browse the repository at this point in the history
  • Loading branch information
Vorta committed Mar 25, 2020
1 parent 776735f commit 1961c6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Connection/Nsqd.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ public function handshake(Stream $stream): void
}

/**
* @param Message $message
* @param Message|MessageBag $message
* @return bool
*/
public function publish(Message $message): bool
public function publish($message): bool
{
return
$this->endpoint->getConnType() === 'tcp'
Expand Down
5 changes: 3 additions & 2 deletions src/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use NSQClient\Connection\Pool;
use NSQClient\Logger\Logger;
use NSQClient\Message\Message;
use NSQClient\Message\Bag as MessageBag;

/**
* Class Queue
Expand All @@ -19,13 +20,13 @@ class Queue
/**
* @param Endpoint $endpoint
* @param string $topic
* @param Message $message
* @param Message|MessageBag $message
* @return bool
*/
public static function publish(
Endpoint $endpoint,
string $topic,
Message $message
$message
): bool {
$routes = Lookupd::getNodes($endpoint, $topic);
$route = $routes[rand(0, count($routes) - 1)];
Expand Down

0 comments on commit 1961c6a

Please sign in to comment.