- BC Break: _PHP_ namespaces changed (PSR-4 standard). The _root_ namespace for all _PF_ related scripts is Exodus4D\Pathfinder
- BC Break: Project folder structure changed. Removed `app/main` dir. - BC Break: Core _PHP_ framework + dependencies moved into `composer.json` and are no longer part of this repo
This commit is contained in:
38
app/Lib/Socket/NullSocket.php
Normal file
38
app/Lib/Socket/NullSocket.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Exodus 4D
|
||||
* Date: 24.03.2019
|
||||
* Time: 23:22
|
||||
*/
|
||||
|
||||
namespace Exodus4D\Pathfinder\Lib\Socket;
|
||||
|
||||
|
||||
use React\Socket;
|
||||
use React\Promise;
|
||||
|
||||
class NullSocket extends AbstractSocket {
|
||||
|
||||
/**
|
||||
* name of Socket
|
||||
*/
|
||||
const SOCKET_NAME = 'webSocket';
|
||||
|
||||
/**
|
||||
* @return Socket\ConnectorInterface
|
||||
*/
|
||||
protected function getConnector(): Socket\ConnectorInterface {
|
||||
return new Socket\Connector($this->getLoop(), $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* write to NullSocket can not be performed
|
||||
* @param string $task
|
||||
* @param null $load
|
||||
* @return Promise\PromiseInterface
|
||||
*/
|
||||
public function write(string $task, $load = null) : Promise\PromiseInterface {
|
||||
return new Promise\RejectedPromise();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user