MAKS\AmqpAgent\Client
A class returns everything AMQP Agent has to offer. A simple service container so to say.
Example:
```
$config = new Config('path/to/some/config-file.php');
$client = new Client($config);
$publisher = $client->getPublisher(); // or $client->get('publisher');
$consumer = $client->getConsumer(); // or $client->get('consumer');
```
Synopsis
- // members
- protected Config $config;
- protected Publisher $publisher;
- protected Consumer $consumer;
- protected ClientEndpoint $clientEndpoint;
- protected ServerEndpoint $serverEndpoint;
- protected Serializer $serializer;
- protected Logger $logger;
- // methods
- public void __construct()
- public mixed __get()
- public Config|Publisher|Consumer|Serializer|Logger get()
- public static array gettable()
- public Publisher getPublisher()
- public Consumer getConsumer()
- public ClientEndpoint getClientEndpoint()
- public ServerEndpoint getServerEndpoint()
- public Serializer getSerializer()
- public Logger getLogger()
- public Config getConfig()
Coverage
Methods | 100% | 11 / 11 |
Lines | 100% | 60 / 60 |
Members
protected
- $clientEndpoint
—
MAKS\AmqpAgent\RPC\ClientEndpoint
An instance of the RPC Client class. - $config
—
MAKS\AmqpAgent\Config
An instance of the configuration object. - $consumer
—
MAKS\AmqpAgent\Worker\Consumer
An instance of the Consumer class. - $logger
—
MAKS\AmqpAgent\Helper\Logger
An instance of the Logger class. - $publisher
—
MAKS\AmqpAgent\Worker\Publisher
An instance of the Publisher class. - $serializer
—
MAKS\AmqpAgent\Helper\Serializer
An instance of the Serializer class. - $serverEndpoint
—
MAKS\AmqpAgent\RPC\ServerEndpoint
An instance of the RPC Server class.
Methods
public
- __construct() — Client object constructor.
- __get() — Gets a class member via public property access notation.
- get() — Returns an instance of a class by its name (lowercase, UPPERCASE, PascalCase, camelCase, dot.case, kebab-case, or snake_case representation of class name).
- getClientEndpoint() — Returns an instance of the RPC Client class.
- getConfig() — Returns the currently used config object.
- getConsumer() — Returns an instance of the Consumer class.
- getLogger() — Returns an instance of the Logger class.
- getPublisher() — Returns an instance of the Publisher class.
- getSerializer() — Returns an instance of the Serializer class.
- getServerEndpoint() — Returns an instance of the RPC Server class.
- gettable() — Returns an array of available members that can be obtained via `self::get()`.
History
-
2021-01-12T21:10:21+00:00 (commit #f7f7e61)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Fix typos * Update DocBlocks
-
2021-01-12T21:10:21+00:00 (commit #177c444)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Fix coding style issue
-
2021-01-12T21:10:21+00:00 (commit #d09424b)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Add strict types declaration * Add declare(strict_types=1) to all files * Fix file header DocBlock spacing of all files
-
2020-12-03T22:51:36+00:00 (commit #c3f5beb)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Change an internal method call due to last code refactoring
-
2020-12-03T00:34:47+00:00 (commit #51d3a61)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Add $clientEndpoint property * Add $serverEndpoint property * Add getClientEndpoint() method * Add getServerEndpoint() method
-
2020-11-27T21:09:36+00:00 (commit #e34d90f)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Add @since to gettable() method DocBlock
-
2020-09-30T12:58:21+00:00 (commit #2b772d3)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Remove not implemented yet return types from DocBlock introduced by last commit * Fix coding style issue
-
2020-09-30T12:04:05+00:00 (commit #438815a)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Add gettable method * Refactor get method
-
2020-09-23T18:47:06+00:00 (commit #1a3f203)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Fix typos and update DocBlocks * Fix some typos in DockBlocks and other parts of the codebase * Add examples to classes DocBlocks
-
2020-09-13T22:05:15+00:00 (commit #e6bf808)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Update client class * Refactor an if statement * Change visibility of class properties to allow inheritance
-
2020-06-15T00:28:43+00:00 (commit #09a31c0)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Fix client class * Remove optional parameter from client class constructor
-
2020-06-13T06:01:42+00:00 (commit #2fc3ca5)
Author: Marwan Al-Soltany (MarwanAlsoltany@gmail.com) / Commiter: Marwan Al-Soltany (MarwanAlsoltany@gmail.com)
Add client class * Add Client.php