PHP Class Clue\React\Buzz\Io\Sender

Mostra file Open project: clue/buzz-react Class Usage Examples

Public Methods

Method Description
__construct ( React\HttpClient\Client $http )
createFromLoop ( React\EventLoop\LoopInterface $loop ) : self create a new default sender attached to the given event loop
createFromLoopConnectors ( React\EventLoop\LoopInterface $loop, React\SocketClient\ConnectorInterface $connector, React\SocketClient\ConnectorInterface $secureConnector = null ) : self create sender attached to given event loop using the given connectors
createFromLoopDns ( React\EventLoop\LoopInterface $loop, React\Dns\Resolver\Resolver | string $dns ) : self create sender attached to the given event loop and DNS resolver
createFromLoopUnix ( React\EventLoop\LoopInterface $loop, string $path ) : self create a sender that sends *everything* through given UNIX socket path
send ( Psr\Http\Message\RequestInterface $request, MessageFactory $messageFactory ) : PromiseInterface

Method Details

__construct() public method

public __construct ( React\HttpClient\Client $http )
$http React\HttpClient\Client

createFromLoop() public static method

create a new default sender attached to the given event loop
public static createFromLoop ( React\EventLoop\LoopInterface $loop ) : self
$loop React\EventLoop\LoopInterface
return self

createFromLoopConnectors() public static method

create sender attached to given event loop using the given connectors
public static createFromLoopConnectors ( React\EventLoop\LoopInterface $loop, React\SocketClient\ConnectorInterface $connector, React\SocketClient\ConnectorInterface $secureConnector = null ) : self
$loop React\EventLoop\LoopInterface
$connector React\SocketClient\ConnectorInterface default connector to use to establish TCP/IP connections
$secureConnector React\SocketClient\ConnectorInterface secure connector to use to establish TLS/SSL connections (optional, composed from given default connector)
return self

createFromLoopDns() public static method

create sender attached to the given event loop and DNS resolver
public static createFromLoopDns ( React\EventLoop\LoopInterface $loop, React\Dns\Resolver\Resolver | string $dns ) : self
$loop React\EventLoop\LoopInterface
$dns React\Dns\Resolver\Resolver | string DNS resolver instance or IP address
return self

createFromLoopUnix() public static method

create a sender that sends *everything* through given UNIX socket path
public static createFromLoopUnix ( React\EventLoop\LoopInterface $loop, string $path ) : self
$loop React\EventLoop\LoopInterface
$path string
return self

send() public method

public send ( Psr\Http\Message\RequestInterface $request, MessageFactory $messageFactory ) : PromiseInterface
$request Psr\Http\Message\RequestInterface
$messageFactory Clue\React\Buzz\Message\MessageFactory
return PromiseInterface Promise