Created
May 27, 2016 12:34
-
-
Save tuscanicz/0630af2efdde535646dfb4fc40f1e5e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace KutnyLib\RabbitMq; | |
use PhpAmqpLib\Connection\AbstractConnection; | |
class AmqpChannelFactory | |
{ | |
private $connection; | |
public function __construct( | |
AbstractConnection $connection | |
) { | |
$this->connection = $connection; | |
} | |
public function createChannelFromPid() | |
{ | |
$channelId = getmypid() % 65535; | |
return $this->connection->channel($channelId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment