Advertisement
Guest User

Untitled

a guest
May 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2.  
  3. namespace KutnyLib\RabbitMq;
  4.  
  5. use PhpAmqpLib\Connection\AbstractConnection;
  6.  
  7. class AmqpChannelFactory
  8. {
  9. private $connection;
  10.  
  11. public function __construct(
  12. AbstractConnection $connection
  13. ) {
  14. $this->connection = $connection;
  15. }
  16.  
  17. public function createChannelFromPid()
  18. {
  19. $channelId = getmypid() % 65535;
  20.  
  21. return $this->connection->channel($channelId);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement