TMultiplexedProcessor is a Processor allowing
* a single TServer
to provide multiple services.
*
*
To do so, you instantiate the processor and then register additional * processors with it, as shown in the following example:
* *
* $processor = new TMultiplexedProcessor();
*
* processor->registerProcessor(
* "Calculator",
* new \tutorial\CalculatorProcessor(new CalculatorHandler()));
*
* processor->registerProcessor(
* "WeatherReport",
* new \tutorial\WeatherReportProcessor(new WeatherReportHandler()));
*
* $processor->process($protocol, $protocol);
*
*/
class TMultiplexedProcessor
{
private $serviceProcessorMap_;
/**
* 'Register' a service with this TMultiplexedProcessor
. This
* allows us to broker requests to individual services by using the service
* name to select them at request time.
*
* @param serviceName Name of a service, has to be identical to the name
* declared in the Thrift IDL, e.g. "WeatherReport".
* @param processor Implementation of a service, usually referred to
* as "handlers", e.g. WeatherReportHandler implementing WeatherReport.Iface.
*/
public function registerProcessor($serviceName, $processor)
{
$this->serviceProcessorMap_[$serviceName] = $processor;
}
/**
* This implementation of process
performs the following steps:
*
*