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