PHP Classes

File: docs/api/files/Communication/TThreadCommunication.php.txt

Recommend this page to a friend!
  Classes of AlexanderC   Threadator   docs/api/files/Communication/TThreadCommunication.php.txt   Download  
File: docs/api/files/Communication/TThreadCommunication.php.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Threadator
Create threads and send messages between them
Author: By
Last change: Update of docs/api/files/Communication/TThreadCommunication.php.txt
Date: 5 months ago
Size: 1,052 bytes
 

Contents

Class file image Download
<?php /** * @author AlexanderC <self@alexanderc.me> * @date 4/8/14 * @time 12:37 AM */ namespace Threadator\Communication; trait TThreadCommunication { /** * @param mixed $message * @return bool */ public function sendMessage($message) { return $this->communication->send($this->getPid(), $message); } /** * Try to get message, but do not block * * @param mixed $message * @return bool */ public function touchMessage(& $message) { return $this->communication->touch( $this->getPid() - $this->getParentPid() + ICommunicationConstants::COMM_RECEIVER_PAD, $message ); } /** * Block until the first message arrives * * @param mixed $message * @return bool */ public function receiveMessage(& $message) { return $this->communication->receive( $this->getPid() - $this->getParentPid() + ICommunicationConstants::COMM_RECEIVER_PAD, $message ); } }