MAKS\AmqpAgent\RPC\ServerEndpoint::serve
Listens on requests coming via the passed queue and processes them with the passed callback.
Alias for `self::respond()`.
Signature
public function serve([callable
        $callback = NULL,
            [string
        $queueName = NULL]] )
            
        Parameters
- $callback— callable
- [optional] The callback to process the request. This callback will be passed an `AMQPMessage` and must return a string.
 
- $queueName— string
- [optional] The queue to listen on.
 
Returns
- string
- The last processed request.
Errors/Exceptions
- 
            RPCEndpointException
- If the server is not connected yet or if the passed callback didn't return a string.
Defined by Interface
Test Coverage
Information
- Coverage: 1/1 Lines (100%)
- Tests: 1
- Passed: 1 (100%)
Tests
- [ PASSED ] — MAKS\AmqpAgent\Tests\RPC\ServerEndpointTest::testRespondMethodViaAliasMethodServe