Service processor for Interface, which implements TProcessor by
synchronously forwarding requests for the service methods to a handler
implementing Interface.
The generated class implements TProcessor and additionally allows a
TProcessorEventHandler to be specified via the public eventHandler property.
The constructor takes a single argument of type Interface, which is the
handler to forward the requests to:
If Interface is derived from another service BaseInterface, this class is
also derived from TServiceProcessor!BaseInterface.
The optional Protocols template tuple parameter can be used to specify
one or more TProtocol implementations to specifically generate code for. If
the actual types of the protocols passed to process() at runtime match one
of the items from the list, the optimized code paths are taken, otherwise,
a generic TProtocol version is used as fallback. For cases where the input
and output protocols differ, TProtocolPair!(InputProtocol, OutputProtocol)
can be used in the Protocols list:
interfaceFooService { voidfoo(); }
classFooImpl { overridevoidfoo {} }
// Provides fast path if TBinaryProtocol!TBufferedTransport is used for// both input and output:aliasTServiceProcessor!(FooService, TBinaryProtocol!TBufferedTransport)
BinaryProcessor;
autoproc = newBinaryProcessor(newFooImpl());
// Low overhead.proc.process(tBinaryProtocol(tBufferTransport(someSocket)));
// Not in the specialization list – higher overhead.proc.process(tBinaryProtocol(tFramedTransport(someSocket)));
// Same as above, but optimized for the Compact protocol backed by a// TPipedTransport for input and a TBufferedTransport for output.aliasTServiceProcessor!(FooService, TProtocolPair!(
TCompactProtocol!TPipedTransport, TCompactProtocol!TBufferedTransport)
) MixedProcessor;
Service processor for Interface, which implements TProcessor by synchronously forwarding requests for the service methods to a handler implementing Interface.
The generated class implements TProcessor and additionally allows a TProcessorEventHandler to be specified via the public eventHandler property. The constructor takes a single argument of type Interface, which is the handler to forward the requests to:
If Interface is derived from another service BaseInterface, this class is also derived from TServiceProcessor!BaseInterface.
The optional Protocols template tuple parameter can be used to specify one or more TProtocol implementations to specifically generate code for. If the actual types of the protocols passed to process() at runtime match one of the items from the list, the optimized code paths are taken, otherwise, a generic TProtocol version is used as fallback. For cases where the input and output protocols differ, TProtocolPair!(InputProtocol, OutputProtocol) can be used in the Protocols list: