Struct thrift::server::TMultiplexedProcessor
[−]
[src]
pub struct TMultiplexedProcessor { /* fields omitted */ }
A TProcessor
that can demux service calls to multiple underlying
Thrift services.
Users register service-specific TProcessor
instances with a
TMultiplexedProcessor
, and then register that processor with a server
implementation. Following that, all incoming service calls are automatically
routed to the service-specific TProcessor
.
A TMultiplexedProcessor
can only handle messages sent by a
TMultiplexedOutputProtocol
.
Methods
impl TMultiplexedProcessor
[src]
fn new() -> TMultiplexedProcessor
Create a new TMultiplexedProcessor
with no registered service-specific
processors.
fn register<S: Into<String>>(
&mut self,
service_name: S,
processor: Box<TProcessor + Send + Sync>,
as_default: bool
) -> Result<()>
&mut self,
service_name: S,
processor: Box<TProcessor + Send + Sync>,
as_default: bool
) -> Result<()>
Register a service-specific processor
for the service named
service_name
. This implementation is also backwards-compatible with
non-multiplexed clients. Set as_default
to true
to allow
non-namespaced requests to be dispatched to a default processor.
Returns success if a new entry was inserted. Returns an error if:
* A processor exists for service_name
* You attempt to register a processor as default, and an existing default exists
Trait Implementations
impl Default for TMultiplexedProcessor
[src]
fn default() -> TMultiplexedProcessor
Returns the "default value" for a type. Read more
impl TProcessor for TMultiplexedProcessor
[src]
fn process(
&self,
i_prot: &mut TInputProtocol,
o_prot: &mut TOutputProtocol
) -> Result<()>
&self,
i_prot: &mut TInputProtocol,
o_prot: &mut TOutputProtocol
) -> Result<()>
Process a Thrift service call. Read more