PHP Class Disque\Client

显示文件 Open project: mariano/disque-php Class Usage Examples

Protected Properties

Property Type Description
$commandHandlers array Command handlers
$connectionManager Disque\Connection\ManagerInterface Connection manager

Public Methods

Method Description
__call ( $command, array $arguments )
__construct ( array $servers = [] ) Create a new Client
connect ( ) : Disque\Connection\Node\Node Connect to Disque
getConnectionManager ( ) : Disque\Connection\ManagerInterface Get the connection manager
isConnected ( ) : boolean Tells if connection is established
queue ( string $name ) : Queue Get a queue
registerCommand ( Disque\Command\CommandInterface $commandHandler ) : void Register a command handler
setConnectionManager ( Disque\Connection\ManagerInterface $manager ) Set a connection manager

Method Details

__call() public method

public __call ( $command, array $arguments )
$arguments array

__construct() public method

Create a new Client
public __construct ( array $servers = [] )
$servers array

connect() public method

Connect to Disque
public connect ( ) : Disque\Connection\Node\Node
return Disque\Connection\Node\Node Connected node information

getConnectionManager() public method

Get the connection manager
public getConnectionManager ( ) : Disque\Connection\ManagerInterface
return Disque\Connection\ManagerInterface Connection manager

isConnected() public method

Tells if connection is established
public isConnected ( ) : boolean
return boolean Success

queue() public method

Get a queue
public queue ( string $name ) : Queue
$name string Queue name
return Disque\Queue\Queue Queue

registerCommand() public method

Register a command handler
public registerCommand ( Disque\Command\CommandInterface $commandHandler ) : void
$commandHandler Disque\Command\CommandInterface Command
return void

setConnectionManager() public method

Set a connection manager
public setConnectionManager ( Disque\Connection\ManagerInterface $manager )
$manager Disque\Connection\ManagerInterface

Property Details

$commandHandlers protected_oe property

Command handlers
protected array $commandHandlers
return array

$connectionManager protected_oe property

Connection manager
protected ManagerInterface,Disque\Connection $connectionManager
return Disque\Connection\ManagerInterface