2018-04-15 16:41:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace NoccyLabs\Ipc\Interop\Channel;
|
|
|
|
|
|
|
|
|
|
|
|
interface ChannelInterface
|
|
|
|
{
|
2018-04-15 22:08:19 +02:00
|
|
|
/**
|
|
|
|
* Check if the channel is open
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2018-04-15 16:41:46 +02:00
|
|
|
public function isOpen():bool;
|
|
|
|
|
2018-04-15 22:08:19 +02:00
|
|
|
/**
|
|
|
|
* Receive (and unserialize) a frame of data.
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-04-15 16:41:46 +02:00
|
|
|
public function receive();
|
|
|
|
|
2018-04-15 22:08:19 +02:00
|
|
|
/**
|
2018-04-16 02:52:51 +02:00
|
|
|
* Send a frame of data, returns true on success
|
2018-04-15 22:08:19 +02:00
|
|
|
*
|
|
|
|
* @param mixed $data
|
2018-04-16 02:52:51 +02:00
|
|
|
* @return bool
|
2018-04-15 22:08:19 +02:00
|
|
|
*/
|
2018-04-16 02:52:51 +02:00
|
|
|
public function send($data):bool;
|
2018-04-15 16:41:46 +02:00
|
|
|
}
|